PHP 4.0 Bug #7844: object inside a session registered object is not restored correctly
| From: | mhaertl at weiden dot de | Date: | Thu, 16 Nov 2000 15:52:18 +0000 |
| Subject: | PHP 4.0 Bug #7844: object inside a session registered object is not restored correctly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-38345@lists.php.net to get a copy of this message | ||
From: mhaertl@weiden.de
Operating system: Linux
PHP version: 4.0.3pl1
PHP Bug Type: *Session related
Bug description: object inside a session registered object is not restored correctly
Since i updated to php-4.0.3pl1 from 4.0.1pl2 registering objects doesn't work correctly for
me.
What i do is the following:
- create a object "a" from a class "myclass"
- in the constructor myclass() i create a new object "x" $this->x from class
"innerclass"
- when i register my object "a" and restore it, i get an error when i try to call a method
of $this->x
in object "a"
Here an Example. This works in php-4.0.1pl2 but not in php-4.0.3pl1 (You get an error when pressing
reload link)
filename: index.php
<?php
class myclass {
function myclass() {
$this->x = new innerobject;
}
function show() {
$this->x->go();
}
}
class innerobject {
function go() {
print "I'm in go() now!<br>";
}
}
session_register("a");
if (! is_object($a) ) {
$a = new myclass;
}
$a->show();
?>
<br>
<a href="index.php">reload</a>
?>
--
Edit Bug report at: http://bugs.php.net/?id=7844&edit=1