Where is my parent?
| From: | Chien-pin Wang | Date: | Fri, 16 Mar 2001 03:16:27 +0000 |
| Subject: | Where is my parent? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-44200@lists.php.net to get a copy of this message | ||
Dear All,
Is there a way to re-write a method in parent class and still access
the parent class by parent::method()?
I have a class (classChild) extended from another class
(classParent). In classChild I have re-implemented method foo() as a
wrapper function of method foo() in classParent. Method foo() in
classChild calls method foo() in classParent by parent::foo().
The scheme works out fine when I test it by writing a shell script
that runs a CGI version of php. But when I run it through apache module, I
got a fatal error saying 'No parent class available in this context'. I
have made sure the parent class file is included, and the classChild
'EXTENDS' the classParent. Now, where is my parent?
Thanks in advance for any comment and suggestion.
Chien-pin
P.S.: PHP CGI version is 4.0.2, apache module version is 4.0.4pl1