1 <?php 2 class A { 3 public function getName() 4 { 5 echo $this->name(); 6 } 7 8 function name () 9 { 10 return 'love'; 11 } 12 } 13 14 class B extends A{ 15 16 public function name () 17 { 18 return "hate"; 19 } 20 } 21 22 (new B())->getName(); 23 ?>