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

1.1       misho       1: --TEST--
                      2: Crash when function parameter modified via reference
                      3: --FILE--
                      4: <?php
                      5: function usercompare($a,$b) {
                      6:   unset($GLOBALS['my_var'][2]); 
                      7:   return 0;
                      8: }
                      9: $my_var = array(1 => "entry_1",
                     10: 2 => "entry_2",
                     11: 3 => "entry_3",
                     12: 4 => "entry_4",
                     13: 5 => "entry_5");
                     14: usort($my_var, "usercompare");
                     15: 
                     16: echo "Done.\n";
                     17: ?>
                     18: --EXPECTF--
                     19: 
                     20: Warning: usort(): Array was modified by the user comparison function in %s on line %d
                     21: Done.

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