#23728 [Opn]: serialize doesn't like namespaces
ID: 23728
User updated by: sputnik at reflexx dot net
Reported By: sputnik at reflexx dot net
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: FreeBSD 5.0
PHP Version: 5CVS-2003-05-20 (dev)
New Comment:
It appears in var_unserializer.c that the old class_table lookup
mechanism is being used, without the use of namespaces. If I can figure
out how to fix it in the code I'll post the results. This problem is
severely affecting my app :(
Previous Comments:
------------------------------------------------------------------------
[2003-05-20 21:29:21] sputnik at reflexx dot net
an object that is in a namespaced class that is serialized and then
deserialized becomes a "__PHP_Incomplete_Class Object (
[__PHP_Incomplete_Class_Name]". It seems serialize/deserialize don't
understand namespaces.
Namespace app {
class berries {
public $name;
public $quantity;
function __construct($name=NULL) {
$this->name = $name;
}
}
$object = new app::berries("aberry");
$objecttext = serialize($object);
$objectnew = unserialize($objecttext);
print_r($objectnew);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23728&edit=1
Thread (3 messages)