PHP object-oriented features

From: Date: Mon, 17 Dec 2001 00:42:16 +0000
Subject: PHP object-oriented features
Groups: php.general 
Request: Send a blank email to php-general+get-77889@lists.php.net to get a copy of this message
Hi there, Just wondering if there is any plans for more work on the PHP OO features, and/or the parser in relation to these features. Generally I find the PHP OO features to be quite useful, but there is some major limitations which often frustrate me at times, for example: $result = $object->method()->returnedObject->anotherMethod(); That won't work with PHP as it is now. Instead, you'd have to do this: $returnedObject = $object->method(); $result = $returnedObject->anotherMethod(); :( Seems like a simple annoyance, right? Well some code I'm working on would work best like this: $object->getSomething()->getSomething()->getSomething()->addSomething("foo") ; Instead, all you can do is this: $result = $object->getSomething(); $result = $result->getSomething(); $result = $result->getSomething(); $result->addSomething("foo"); Again, not good. :( Another thing is multiple inheritance, or 'implementing' an object, rather than extending just one. Like this: class Foo extends Bar implements Eep { } Foo is a subclass of Bar, but *uses* the methods/attributes of Eep. Yeah, I know, PHP is not at heart an OO language, but I really LIKE PHP! I don't want to use JSP or something because I think Java is slow and over complicated. So, is there any chance that these features could be added in the future at some stage? Please? ;) Cheers, Colin.

« previous php.general (#77889) next »