class a{
function _a(){
echo "i am parent function";
$this->test();
}
function test(){
echo "i am parent function test";
}
}
class b extends a{
function test(){
echo "i am child function test";
}
}
$obj = new a;
$obj->_a();
输出值:i am parent function
i am child function test
原因:调用的是子类中的方法