|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30826 Serialize using lowercase "r" for recursive references in some cases
Submitted: 2004-11-18 15:53 UTC Modified: 2004-11-18 23:14 UTC
From: jan at horde dot org Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4CVS-2004-11-18 (stable) OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jan at horde dot org
New email:
PHP Version: OS:


 [2004-11-18 15:53 UTC] jan at horde dot org
See the attached test script.

If you use 
$file->a[0] = &$log; 
instead of 
$file->a[0] = $log;
everything works fine and you can unserialize the string. But the serialization with the lowercase "r" throws an error when during unserialization.

Reproduce code:
Bug # (Wrong serialization of objects with recursive references)

$rep = new stdClass;
$file = new stdClass;
$log = new stdClass;

$file->rep = &$rep;
$log->file = &$file;
$file->a[0] = $log;

echo serialize($file);



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-18 23:14 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 09:01:33 2024 UTC