PHP 4.0 Bug #7844 Updated: object inside a session registered object is not restored correctly
| From: | sniper@php.net | Date: | Fri, 17 Nov 2000 17:34:50 +0000 |
| Subject: | PHP 4.0 Bug #7844 Updated: object inside a session registered object is not restored correctly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-38445@lists.php.net to get a copy of this message | ||
ID: 7844
Updated by: sniper
Reported By: mhaertl@weiden.de
Status: Closed
Bug Type: *Session related
Assigned To:
Comments:
Fixed in CVs.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-11-16 10:52:18] mhaertl@weiden.de
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>
?>
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7844