For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > September 2005 > classes parent::parent









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author classes parent::parent
Stefan Varga

2005-09-25, 7:56 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com