Re: parent constructor
| From: | John Donagher | Date: | Wed, 07 Feb 2001 15:54:44 +0000 |
| Subject: | Re: parent constructor | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-38609@lists.php.net to get a copy of this message | ||
Try 'parent::'
On Wed, 7 Feb 2001, Aaron Tuller wrote:
> At 12:13 PM +0100 2/7/01, Christian Reiniger wrote:
> >On Wednesday 07 February 2001 05:14, Aaron Tuller wrote:
> > > $parentClass = get_parent_class($this);
> >> eval("$parentClass::$parentClass();");
> >>
> >> still, I think I should be able to do what I wrote below.
> >
> >Um, you know the name of your parent class, so why do you use
> >get_parent_class() at all?
>
> so that way I can have a general purpose way of calling a parent
> constructor like "super()" or whatever. It seems silly to hardcode
> the name of my parent class into the code of the class besides in the
> "extends" part in the definition. that way if I change the
> hierarchy, I don't have to worry about changing the constructor, it
> just always points to the parent.
>
> sorry if that isn't clear.
>
> -aaron
>
>
--
John Donagher
Application Engineer
Intacct Corp. - Powerful Accounting on the Web
408-395-0989
720 University Ave.
Los Gatos CA 95032
www.intacct.com
Public key available off http://www.keyserver.net
Key fingerprint = 4024 DF50 56EE 19A3 258A D628 22DE AD56 EEBE 8DDD