calling parent class method from the outside



Is there a way to call the parent version of $obj->foo() from outside
the class? That kind of syntax is allowed in C++, for example: Aclass
a; if (a.Aparent::foo()) ...;
(I know of parent::foo(). but it must be called from the method body)

Some contrived example to illustrate the point:

class AParent {
public function foo() { .. }
}

class A extends AParent {
public function foo() {
doit($this, __CLASS__, __FUNCTION__);
}
}

function doit($obj, $classname, $funcname) {
if (...)
// how to do it? $obj->classname_parent::$funcname();
}


Thanks.

.



Relevant Pages