class A{ function __construct{ echo "parent construct called"; } } class B extends A{ function __construct{ echo "child construct called"; parent::__construct(); } } myobj = new B();