Q. What will be the output?
Code:class A {
public function __construct() { echo 'A'; }
}
class B extends A {
public function __construct() { echo 'B'; }
}
new B();
β
Correct Answer: (B)
B
Explanation: Child constructor overrides parent unless explicitly called.