class cart extends abc {
function cart() { echo("hello 1"); }
}
class abc {
function abc() { echo("hello 2"); }
$cart_instance = new cart();
why doesn't this output "hello 2"? is the constructor of an extended not called? is there a workaround?
Well, the documentation says "Caution: For derived classes, the constructor of the parent class is not automatically called when the derived class's constructor is called."
Try calling it explicitly.