|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-09-20 19:27 UTC] sas@php.net
[2000-10-16 11:13 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 12 23:00:01 2026 UTC |
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.