Q. What will be the output?
Code:
class A { public function test() { echo 'A'; } }
class B extends A { public function test() { echo 'B'; } }
$obj = new B();
$obj->test();
β
Correct Answer: (B)
B
Explanation: Method overriding: child class method is called.