PHP 4.0 Bug #6941: References are not maintained through sessions

From: Date: Fri, 29 Sep 2000 16:39:36 +0000
Subject: PHP 4.0 Bug #6941: References are not maintained through sessions
Groups: php.dev 
Request: Send a blank email to php-dev+get-33863@lists.php.net to get a copy of this message
From: robert.hartman@eyeo.com Operating system: Linux/i586 PHP version: 4.0.2 PHP Bug Type: *Session related Bug description: References are not maintained through sessions PHP causes httpd to segfault with the following scripts. Basically, we feel that when the objects get restored at session_start the references are no longer valid. Apache Error Log: [Thu Sep 28 19:55:57 2000] [notice] child pid 255 exit signal Segmentation fault (11) === file 1 === <? class parentClass { var $child; var $relation = "mother"; function makeChild() { $this->child = new ChildClass($this); } } class childClass { var $parentLink; function childClass(&$parent) { $this->parentLink = &$parent; } } session_start(); session_register("mom"); $mom = new parentClass; $mom->makeChild(); ?> <html> <? echo $mom->child->parentLink->relation . "<br>"; ?> <a href="next.phtml">next</a> </html> === file 2 === <? class parentClass { var $relation = "mother"; } class childClass { var $parentLink; function childClass(&$parent) { $this->parentLink = &$parent; } } session_start(); session_register("mom"); ?> <html> <? echo $son->parentLink->relation . "<br>"; ?> <a href="next.phtml">next</a> </html>

« previous php.dev (#33863) next »