Re: classes parent::parent
| From: | Friedhelm Betz | Date: | Tue, 04 Oct 2005 19:55:21 +0000 |
| Subject: | Re: classes parent::parent | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969370456@lists.php.net to get a copy of this message | ||
Stefan Varga wrote:
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() {Please, ask support questions at one of the available mailinglists: http://www.php.net/mailing-lists.php Friedhelmecho "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.