PHP 4.0 Bug #7351: after $obj->obj2->method() call, serialize() doesn't see $obj->obj2 any more

From: Date: Thu, 19 Oct 2000 22:09:05 +0000
Subject: PHP 4.0 Bug #7351: after $obj->obj2->method() call, serialize() doesn't see $obj->obj2 any more
Groups: php.dev 
Request: Send a blank email to php-dev+get-35572@lists.php.net to get a copy of this message
From: dolecek@ibis.cz Operating system: NetBSD 1.5H PHP version: 4.0.3pl1 PHP Bug Type: Scripting Engine problem Bug description: after $obj-&gt;obj2-&gt;method() call, serialize() doesn't see $obj-&gt;obj2 any more I use PHP4.0.3pl1 loaded as DSO module to Apache 1.3.12. I have an object, which contains another object. I found out, that if a method is called via the parent object (like $obj->obj2->method()), serialize() no longer sees the child object and hence doesn't include it to it's output. This is quite a problem, since this is default session storage method (I believe php_binary is affected too, though I've not tested that). Strange is that print_r() still prints the object correctly. This problem was NOT in 4.0.1pl2 - it's working okay with that version on the same machine. Following script reproduces the problem for me any time: <?php class l { function get() { } } class s { var $l; function s() { $this->l = new l(); } } $s = new s(); echo "<h4>before</h4>\n"; print_r($s); echo "<br>" . serialize($s); $q = $s->l->get(); echo "<h4>after</h4>\n"; print_r($s); echo "<br>" . serialize($s); ?> -- Edit Bug report at: http://bugs.php.net/?id=7351&edit=1

« previous php.dev (#35572) next »