RE: [PHP] PHP object-oriented features
| From: | Martin Towell | Date: | Mon, 17 Dec 2001 01:05:21 +0000 |
| Subject: | RE: [PHP] PHP object-oriented features | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-77891@lists.php.net to get a copy of this message | ||
I totally agree with you!!
From what someone told me, the new version of the Zend engine will fully
support OOP (but don't quote me on this as I haven't had time to look at the
Zend site to confirm this) - I'm looking forward to seeing it. This would
make PHP a really powerful language then!!
Martin
-----Original Message-----
From: Colin Tucker [mailto:colin@maven.com.au]
Sent: Monday, December 17, 2001 11:42 AM
To: php-general@lists.php.net
Subject: [PHP] PHP object-oriented features
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net