|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-11-18 23:14 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 21:00:01 2025 UTC |
Description: ------------ 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: --------------- --TEST-- Bug # (Wrong serialization of objects with recursive references) --FILE-- <?php $rep = new stdClass; $file = new stdClass; $log = new stdClass; $file->rep = &$rep; $log->file = &$file; $file->a[0] = $log; echo serialize($file); ?> --EXPECT-- O:8:"stdClass":2:{s:3:"rep";O:8:"stdClass":0:{}s:1:"a";a:1:{i:0;O:8:"stdClass":1:{s:4:"file";O:8:"stdClass":2:{s:3:"rep";R:2;s:1:"a";a:1:{i:0;R:4;}}}}}