PHP 4.0 Bug #9587 Updated: obj->method()->method2() doesn't work!!

From: Date: Thu, 08 Mar 2001 17:43:32 +0000
Subject: PHP 4.0 Bug #9587 Updated: obj->method()->method2() doesn't work!!
Groups: php.dev 
Request: Send a blank email to php-dev+get-48293@lists.php.net to get a copy of this message
ID: 9587 Updated by: stas Reported By: docwhat@gerf.org Old-Status: Open Status: Analyzed Bug Type: Class/Object related Assigned To: Comments: Yes, this is a known problem. Previous Comments: --------------------------------------------------------------------------- [2001-03-06 15:31:04] docwhat@gerf.org You cannot do the following: obj->method()->method2(); Mini example: class Foo{ var $obj; setObj( &$obj ) { $this->obj =& $obj; } &getObj() { return $this->obj; } hello() { print "hin"; } } $a = new Foo; $b = new Foo; $b->setObj( $a ); $a->getObj()->hello(); // Doesn't work In fact, this doesn't work either: function foob() { global $a; return $a; } foo()->hello(); In addition, anything that hands objects back doesn't work right. You can't chain certain things, like new commands. All in all, the objects are rather inflexable. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9587&edit=2

« previous php.dev (#48293) next »