PHP 4.0 Bug #4285: Unexpected warning using an object in a session
| From: | yzhang at sfu dot ca | Date: | Mon, 01 May 2000 02:13:58 +0000 |
| Subject: | PHP 4.0 Bug #4285: Unexpected warning using an object in a session | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-18316@lists.php.net to get a copy of this message | ||
From: yzhang@sfu.ca
Operating system: Linux (Redhat 6.0)
PHP version: 4.0 Release Candidate 1
PHP Bug Type: Session related
Bug description: Unexpected warning using an object in a session
An unexpected warning comes back when I use an object in a session variable:
The code is this:
<?
error_reporting(15);
session_start();
session_register("SESSION");
if (! isset($SESSION)) {
class object {};
$SESSION = new object;
$SESSION->i = 5;
} else {
echo "My value is: $SESSION->i";
}
?>
Run it twice (first time to register the session, the second time to use it) and you will see this:
Warning: Unserializing non-existant class: stdClass! No methods will be available! in
/home/httpd/htdocs/test.php on line 3
My value is: 5
Not sure why this is a warning, what is stdClass? I find no mention of it in the manual.