#29390 [NEW]: var_dump() treats recursive references differently for objects and arrays

From: Date: Mon, 26 Jul 2004 15:35:24 +0000
Subject: #29390 [NEW]: var_dump() treats recursive references differently for objects and arrays
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-63570@lists.php.net to get a copy of this message
From: tim at tenkan dot org Operating system: linux PHP version: 4.3.7 PHP Bug Type: Scripting Engine problem Bug description: var_dump() treats recursive references differently for objects and arrays 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* } } -- Edit bug report at http://bugs.php.net/?id=29390&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29390&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29390&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29390&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29390&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29390&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29390&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29390&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29390&r=support Expected behavior: http://bugs.php.net/fix.php?id=29390&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29390&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29390&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29390&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29390&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29390&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29390&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29390&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29390&r=float

« previous php.bugs (#63570) next »