Annotation of embedaddon/php/ext/standard/tests/array/bug43495.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #43495 (array_merge_recursive() crashes with recursive arrays)
                      3: --FILE--
                      4: <?php
                      5: $a=array("key1"=>array("key2"=>array()));
                      6: $a["key1"]["key2"]["key3"]=&$a;
                      7: 
                      8: $b=array("key1"=>array("key2"=>array()));
                      9: $b["key1"]["key2"]["key3"]=&$b;
                     10: 
                     11: array_merge_recursive($a,$b); 
                     12: 
                     13: /* Break recursion */
                     14: $a["key1"]["key2"]["key3"] = null;
                     15: $b["key1"]["key2"]["key3"] = null;
                     16: 
                     17: echo "Done.\n";
                     18: ?>
                     19: --EXPECTF--
                     20: Warning: array_merge_recursive(): recursion detected in %sbug43495.php on line %d
                     21: Done.

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>