|  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:
 [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-2015 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 12:01:29 2015 UTC