ID: 9587
Comment by: oopfollower at localhost dot localdomain
Reported By: docwhat at gerf dot org
Status: Closed
Bug Type: Class/Object related
Operating System: Linux/Debian(Woody)
PHP Version: 4.0.4pl1
New Comment:

Of course, it's simplier to close a bug, than fix it.
Long live PHP.


Previous Comments:
------------------------------------------------------------------------

[2001-12-01 12:09:01] [email]sebastianphp.net[/email]

Not a bug, closing.

------------------------------------------------------------------------

[2001-03-08 12:43:31] [email]stasphp.net[/email]

Yes, this is a known problem.

------------------------------------------------------------------------

[2001-03-06 15:31:04] docwhat at gerf dot 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 "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 this bug report at [url]http://bugs.php.net/?id=9587&edit=1[/url]