classes parent::parent
| From: | Stefan Varga | Date: | Sun, 25 Sep 2005 12:14:34 +0000 |
| Subject: | classes parent::parent | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969370313@lists.php.net to get a copy of this message | ||
Hi,
I searched thru the documentation and can not find a way to call a
object's parent's parent method. I do not want to call the direct
parent method. Let me demonstrate on an example.
class A {
function show() {
echo "A";
general handling
}
}
class B extends A {
function show() {
echo "B";
special handling for B;
parent::show();
}
}
class C extends B {
function show() {
echo "C";
special handling C;
parent::parent::show();
}
}
The call parent::parent::show(); in C does not work.
Thanks a lot,
Stefan Varga