Re: [PHP4BETA] calling member in parent class

From: Date: Fri, 04 Feb 2000 12:35:02 +0000
Subject: Re: [PHP4BETA] calling member in parent class
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-9800@lists.php.net to get a copy of this message
Yes, it's true that you will have to know the name of the parent anyway, but that doesn't eliminate the value of a general syntax. It is still not a compelling thought of having that name hard coded into the code in the derived class. You wouldn't duplicate the same integer value across code, rather define it once and use a named constant. Having "parent->method()" means less potential bugs while being obvious for programmers coming from other OO-like languages. There will always be work-arounds, but they tend to be author-specific and can make reading others' code more difficult. § Dan wrote: > > I'm sorry if my "tone" was not obvious. I meant that not being able to have > a keyword is really not a problem at all, that is, you extend the parent in > the same module, it's pretty obvious what the name of the parent is. > > > The big deal is that we want to start a code freeze and > > making such "not > > big deal" patches always ends up taking some time to stabilize. > > If you desperately need this functionality you can probably use > > get_parent_class() concat it with a "::method()" string and > > then eval() it. > > That is kind of messed up and slow so I suggest to find a > > different way > > until we add this functionality. > > > > Andi > > > > At 11:32 PM 2/3/00 -0500, Dan wrote: > > >Have to drop my .02: You extend the parent class, you damn > > well better know > > >the name of the parent class - what's the big deal? > > > > > >Dan Sevush > > >CTO DansChocolates.com > > >happily running PHP4 b2 on six dual CPU boxes > > > > > > > > > > Parent is not a keyword > > > > > > > > > > > >Could it be turned into a keyword to avoid hard-coding the > > > > name of the > > > > > >parent class into the code? > > > > > > > > > > We can put this on our TODO but we really want to > > > > code-freeze Zend now. > > > > > > > > Ok, put it on the TODO then. > > > > > > > > >-- > > >PHP 4.0 Beta Mailing List > > ><http://www.php.net/version4/> > > >To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net > > >For additional commands, e-mail: php4beta-help@lists.php.net > > >To contact the list administrators, e-mail: > > php4beta-admin@lists.php.net > > > > --- > > Andi Gutmans <andi@zend.com> > > http://www.zend.com/ > > > > -- > PHP 4.0 Beta Mailing List <http://www.php.net/version4/> > To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net > For additional commands, e-mail: php4beta-help@lists.php.net > To contact the list administrators, e-mail: php4beta-admin@lists.php.net -- Stefan Lindmark, M.Sc.C.Sc | Tel +46 (0)8 623 9182 SE Manager | Mobile +46 (0)70 623 9182 Sun Microsystems AB | Fax +46 (0)8 623 9005 Box 51, S-164 94 Kista, Sweden | E-mail stefan.lindmark@sweden.sun.com

Attachment: [text/x-vcard] Card for Stefan Lindmark - Sun Sweden - SE Manager stefan.lindmark.vcf
« previous php.version4 (#9800) next »