PHP 4.0 Bug #6604 Updated: Restoration of object stored in session fails
| From: | Bug Database | Date: | Wed, 20 Sep 2000 23:27:34 +0000 |
| Subject: | PHP 4.0 Bug #6604 Updated: Restoration of object stored in session fails | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33568@lists.php.net to get a copy of this message | ||
ID: 6604
Updated by: sas
Reported By: balazs.pataki@sztaki.hu
Status: Feedback
Bug Type: *Session related
Assigned To:
Comments:
Works for me. Do you have session.auto_start enabled? Or do you run prepend scripts which call
session_start()/session_register()?
Previous Comments:
---------------------------------------------------------------------------
[2000-09-07 11:37:02] balazs.pataki@sztaki.hu
The following script causes an error, like:
Fatal error: The script tried to execute a method or access a property of an incomplete object.
Please ensure that the class definition test of the object you
are trying to operate on was loaded _before_ the session was started in
/dsd2/www/htdocs/cow/test.php on line 12
The script:
<?
class test {
var $x;
}
session_register ("sessVar");
if ($sessVar == null) {
$sessVar = new test();
$sessVar->x = "foo";
echo "foo set. Reload!";
}
else {
echo $sessVar->x;
}
?>
Here we tried to store a simple object in the session. The first time the script is invoked it
creates a new test object and echos "foo set. Reload!". Then, reloading the script causes
the error message shown above. Sessions with normal (not objects) variables work OK.
This script fails with 4.0.1pl2 as well.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6604