calling parent class method from the outside
- From: rihad@xxxxxxx
- Date: Fri, 29 Jun 2007 22:20:21 -0700
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.
.
- Prev by Date: Selecting Rows Based on Row Values Being in Array
- Next by Date: Re: [PHP] Selecting Rows Based on Row Values Being in Array
- Previous by thread: Selecting Rows Based on Row Values Being in Array
- Next by thread: Date Calculation Help
- Index(es):
Relevant Pages
|