PHP 4.0 Bug #5402 Updated: unserializing "stdClass" objects gives error
| From: | Bug Database | Date: | Thu, 20 Jul 2000 20:52:22 +0000 |
| Subject: | PHP 4.0 Bug #5402 Updated: unserializing "stdClass" objects gives error | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-25289@lists.php.net to get a copy of this message | ||
ID: 5402
User Update by: east@canit.se
Old-Status: Closed
Status: Open
Bug Type: Scripting Engine problem
Description: unserializing "stdClass" objects gives error
Tried again.
The following does not work in PHP Version 4.0.1pl2!
(works fine in 4.0.0)
System Linux heaven 2.2.16 #1 Tue Jun 13 13:58:52 CEST 2000 i586 unknown.
Exact Code (needs reloading once)
---------------------------------
class Foo
{
var $object;
var $str;
function Foo()
{
$this->object->mytest = "testing";
$this->object->other = "hallo";
$this->str = "the following works";
}
}
$myfoo = new Foo();
print("creating foo()<br>\n");
$s_myfoo = serialize($myfoo);
printf("serializing foo() = %s<br>\n", $s_myfoo);
$newfoo = new Foo();
$newfoo = unserialize($s_myfoo);
print("unserializing newfoo<br>\n");
print("printing variable...<br>\n");
printf("newfoo->str = %s<br>\n", $newfoo->str);
printf("newfoo->object->mytest = %s<br>\n", $newfoo->object->mytest);
Full Bug description available at: http://bugs.php.net/?id=5402