Re: PHP 4.0 Bug #5343: a way of implementing class methods

From: Date: Mon, 03 Jul 2000 00:44:51 +0000
Subject: Re: PHP 4.0 Bug #5343: a way of implementing class methods
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-23255@lists.php.net to get a copy of this message
On 3 Jul 2000 teo@digiro.net wrote: > From: teo@digiro.net > Operating system: > PHP version: 4.0.1 > PHP Bug Type: Feature/Change Request > Bug description: a way of implementing class methods > > How about: > function Foo::Bar() { > //implementation of method Bar' in class Foo' > } > > ppl usually separate the functionality in different files, and with > classes this is only possible by forwarding calls to regular functions, > or by making use of derivation, which is not the best practice. > > IMHO that would imply small changes to the parser (to recognize `::' > syntax), what do you think? Are you really sure that you'd like to implement some of a class methods outside the class itself? And what happens, if the method is implemented in an include()d file, so that it might not be include()d at all, or depending on the include()d file, might have totally different behaviour than what you expected? My personal opinion, PHP is not an object oriented language, if I have understood right the comments of core developers on this list, it'll never be one, and (back to personal beliefs) it shouldn't ever become one. And if this feature request will be implemented, I'll move to in the middle of Antarctica and create a new method in some class to some popular PHP based program that needs both fetching a key from me and going to some vague direction at least 100 kilometers away from the base and digging a few hundred meters of ice. So that you'll understand what your request actually means. (I might have been affected by reading Kim Stanley Robinson, recommended reading for all scifi-fans reading this list.) -- Jouni Ahto

« previous php.dev (#23255) next »