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

From: Date: Tue, 06 Mar 2001 20:31:04 +0000
Subject: PHP 4.0 Bug #9587: obj->method()->method2() doesn't work!!
Groups: php.dev 
Request: Send a blank email to php-dev+get-48089@lists.php.net to get a copy of this message
From: docwhat@gerf.org Operating system: Linux/Debian(Woody) PHP version: 4.0.4pl1 PHP Bug Type: Class/Object related Bug description: obj->method()->method2() doesn't work!! 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 "hi\n"; } } $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. -- Edit Bug report at: http://bugs.php.net/?id=9587&edit=1

« previous php.dev (#48089) next »