|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2022 The PHP Group
All rights reserved.
Last updated: Thu Aug 18 20:05:44 2022 UTC