is it possible to call parent class method x or constructor, automatically when child class any method like a,b,c .. is called?
abstract class parentCl {
public function parentMethod()
{
echo "parent call";
}
}
class childCl extends parentCl {
public function __construct() {
echo "construct";
}
public function childMethod($params)
{
echo "child call";
}
public function childMethod2($params)
{
echo "child call2";
}
}
//like this case,
$n = new childCl();
$n->childMethod(123);
$n->childMethod2(1234);
I want parentMethod() to be called