|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-27 14:24 UTC] tony2001@php.net
[2005-02-03 04:58 UTC] sniper@php.net
[2005-02-14 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 02:00:01 2025 UTC |
Description: ------------ var_dump() treats objects and arrays differently when they contain references to themselves. Reproduce code: --------------- <?php class a { } $a = new a(); $a->foo =& $a; var_dump($a); $b = array(); $b[1] =& $b; var_dump($b); ?> Expected result: ---------------- object(a)(1) { ["foo"]=> &object(a)(1) { ["foo"]=> *RECURSION* } } array(1) { [1]=> &array(1) { [1]=> *RECURSION* } } Actual result: -------------- object(a)(1) { ["foo"]=> &object(a)(1) { ["foo"]=> &object(a)(1) { ["foo"]=> *RECURSION* } } } array(1) { [1]=> array(1) { [1]=> *RECURSION* } }