php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23728 serialize doesn't like namespaces
Submitted: 2003-05-20 21:29 UTC Modified: 2003-06-04 22:31 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: sputnik at reflexx dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-05-20 (dev) OS: FreeBSD 5.0
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sputnik at reflexx dot net
New email:
PHP Version: OS:

 

 [2003-05-20 21:29 UTC] 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);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-21 14:34 UTC] sputnik at reflexx dot net
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 :(
 [2003-06-04 22:31 UTC] sterling@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 03:01:33 2025 UTC