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

From: Date: Sun, 22 Oct 2000 15:55:22 +0000
Subject: PHP 4.0 Bug #7351 Updated: 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-35789@lists.php.net to get a copy of this message
ID: 7351 Updated by: stas Reported By: dolecek@ibis.cz Status: Feedback Bug Type: Scripting Engine problem Assigned To: Comments: Please try latest CVS, I guess it's fixed now. Previous Comments: --------------------------------------------------------------------------- [2000-10-19 18:09:04] dolecek@ibis.cz 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); ?> --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7351

« previous php.dev (#35789) next »