我知道这听起来很奇怪,但我试图绕过一个错误。如何调用祖父母方法?
<?php
class Person {
function speak(){ echo 'person'; }
}
class Child extends Person {
function speak(){ echo 'child'; }
}
class GrandChild extends Child {
function speak(){
//skip parent, in order to call grandparent speak method
}
}