可以调用父类方法x或构造函数,当子类调用任何方法如a,b,c ..时会自动调用吗?
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);
我希望调用parentMethod()