Bug #14864: Object and sessions, no way!

From: Date: Sat, 05 Jan 2002 01:24:37 +0000
Subject: Bug #14864: Object and sessions, no way!
Groups: php.dev 
Request: Send a blank email to php-dev+get-75916@lists.php.net to get a copy of this message
From:             jj@thecloud.org
Operating system: Linux Slackware and Cobalt Raq4
PHP version:      4.1.1
PHP Bug Type:     Reproducible crash
Bug description:  Object and sessions, no way!

FIRST OUTPUT:
New object
REFRESH BROWSER:
Fatal error: The script tried to execute a method or access a property of
an incomplete object. Please ensure that the class definition binladen of
the object you are trying to operate on was loaded _before_ the session was
started in test.php on line 16

Note: The class is defined before the session start!

<?php
class BinLaden{
var $wow;
function BinLaden($Parola){
        $this->wow=$Parola;
        }
}

session_start();

if(!isset($wa)) {
        $wa = new BinLaden("Hello Word");
        session_register('wa');
        print "New object<br>";
} else {
        echo($wa->cazz);
        print "Object from session<br>";
}

?>
-- 
Edit bug report at: http://bugs.php.net/?id=14864&edit=1



Thread (8 messages)

« previous php.dev (#75916) next »