The following example does not work, because when called parentin a class, Aphp looks for the parent class of the class A, but it does not exist. I would prefer this line to call Test()in the class B.
Is it possible?
(I know this seems like a dumb example, but it has a practical application)
abstract class A {
function CallParentTest()
{
return call_parent_method('Test');
}
}
abstract class B extends A {
function Test()
{
return 'test passed';
}
}
class C extends B {
function Test()
{
return $this->CallParentTest();
}
}
$object = new C();
echo $object->Test();
Thank!
EDIT
I changed the keyword parentto the compilation method call_parent_method, because I think it may have confused people. I know that there is no way to do this using the keyword.
, , . B::Test() , .