#29390 [Opn->Fbk]: var_dump() treats recursive references differently for objects and arrays
ID: 29390
Updated by: sniper@php.net
Reported By: tim at tenkan dot org
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 4.3.7
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2004-07-27 14:24:50] tony2001@php.net
There are some memory leaks also:
/home/tony/CVS/php-src/Zend/zend_execute.c(662) : Freeing 0x3D17C590
(16 bytes), script=var_dump.test.php
/home/tony/CVS/php-src/Zend/zend_execute.c(3360) : Freeing 0x3D17B9E8
(32 bytes), script=var_dump.test.php
/home/tony/CVS/php-src/Zend/zend_hash.c(169) : Actual location
(location was relayed)
Last leak repeated 1 time
/home/tony/CVS/php-src/Zend/zend_execute.c(3243) : Freeing 0x3D174CB4
(16 bytes), script=var_dump.test.php
------------------------------------------------------------------------
[2004-07-26 17:35:23] tim at tenkan dot org
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 this bug report at http://bugs.php.net/?id=29390&edit=1
Thread (4 messages)