PHP - Inheritance and Polymorphism
What will be the output of the following PHP code?
class ParentClass {
public function __construct() {
echo "Parent constructor called. ";
}
}
class ChildClass extends ParentClass {
public function __construct() {
parent::__construct();
echo "Child constructor called.";
}
}
new ChildClass();