|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-05-27 18:54 UTC] php-bug at undoso dot info
[2008-05-27 19:25 UTC] colder@php.net
[2008-05-27 19:34 UTC] php-bug at undoso dot info
[2008-05-27 19:35 UTC] php-bug at undoso dot info
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 03:00:01 2025 UTC |
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.