ID: 45109 User updated by: php-bug at undoso dot info Reported By: php-bug at undoso dot info -Status: Open +Status: Closed Bug Type: Arrays related Operating System: All PHP Version: 5.2.6 New Comment:
Forgot to close the bug ! Previous Comments: ------------------------------------------------------------------------ [2008-05-27 19:34:54] php-bug at undoso dot info Yes, I was on 5.2.3. Looks like it is not doing that any more. Thanks a lot and sorry for the useless bug ^^ ------------------------------------------------------------------------ [2008-05-27 19:25:56] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi Can't reproduce ------------------------------------------------------------------------ [2008-05-27 18:54:10] php-bug at undoso dot info Sorry, reproduce code is : Reproduce code: --------------- $arr = array(); $arr["loop"] = $arr; print_r($arr); and not the original one. I don't know how I did that change since I just copied the code from my test file... ------------------------------------------------------------------------ [2008-05-27 18:47:15] php-bug at undoso dot info Description: ------------ When assigning into a cell of an array the array itself, the result is incoherent. Since the assignation does not use reference, the array should be copied and not create a magical structure that looks like an infinite loop. The worst is that the array seems impossible to browse using PHP since there is no way to find that we are on a portion that we already visited, or not at my knowing. Reproduce code: --------------- $arr = array(); $arr["loop"] $ arr; print_r($arr); Expected result: ---------------- Array ( [loop] => Array ( ) ) Here is what the resulting print_r should looks like. Since no reference is used, the array should be copied and only after that the loop cell created. Actual result: -------------- The constructed array looks like that: Array ( [loop] => Array *RECURSION* ) wich is inconsistent. By the way, f you find a way to browse this array in PHP and detect that a recursion does exists, I want it because I just can't. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45109&edit=1