|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-03-08 12:43 UTC] stas@php.net
[2001-12-01 12:09 UTC] sebastian@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 16:00:01 2025 UTC |
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.