|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-07-18 09:36 UTC] schmidt at ibou dot de
I have the follow Problem:
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 /u4_1/www/rf/includes/all_sicherheit.inc on line 3
Very simple:
In file 1:
class foo
{
...
}
$x=new foo
$x->... = 123;
session_register("x");
in 2. file:
class foo
{
...
}
echo $x->...;
When I do a session_register("x") befor I printed $x->...
it get the same error.
Is there a Workaround?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
I would like to reaffirm that this is a bug, I've had the same problem storing objects in the session using PHP Version 4.3.4. My work around for the this problem was serializing the object and placing the resulting string in the session, and manually unserializing the object after pulling the string from the session. This bug appeared on the production environment running the php CGI on winnt This bug did NOT appear in my dev environment running php ISAPI, Ill be more than happy to provide init files and any other requested info. ---------------------------------------------------------- class Tester { function TestFunc() { echo "PHP is Busted"; } } session_start(); if(isset($_REQUEST[init])) { $us = new Tester(); $_SESSION[x] = serialize($us); // //$_SESSION[x] = $us; } else { $b = unserialize($_SESSION[x]); // //$b = $_SESSION[x]; print_r($b); } -------------------------------------------------------