tony2001 Fri Dec 3 12:43:23 2004 EDT Added files: /php-src/ext/standard/tests/array array_walk_recursive.phpt
Modified files: /php-src/ext/standard array.c Log: fix array_walk_recursive() so it doesn't reuse cached fci between calls and add test for it http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.285&r2=1.286&ty=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.285 php-src/ext/standard/array.c:1.286 --- php-src/ext/standard/array.c:1.285 Thu Dec 2 11:35:02 2004 +++ php-src/ext/standard/array.c Fri Dec 3 12:43:23 2004 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.285 2004/12/02 16:35:02 tony2001 Exp $ */ +/* $Id: array.c,v 1.286 2004/12/03 17:43:23 tony2001 Exp $ */ #include "php.h" #include "php_ini.h" @@ -1157,6 +1157,8 @@ argc = ZEND_NUM_ARGS(); old_walk_func_name = BG(array_walk_func_name); + BG(array_walk_fci_cache) = empty_fcall_info_cache; + if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &array, &BG(array_walk_func_name), &userdata) == FAILURE) { BG(array_walk_func_name) = old_walk_func_name; http://cvs.php.net/co.php/php-src/ext/standard/tests/array/array_walk_recursive.phpt?r=1.1&p=1 Index: php-src/ext/standard/tests/array/array_walk_recursive.phpt +++ php-src/ext/standard/tests/array/array_walk_recursive.phpt --TEST-- Test array_walk_recursive() --FILE-- <?php function foo($value) { echo $value . " foo\n"; } function bar($value) { echo $value . " bar\n"; } $arr = array (1,2,3); var_dump (array_walk_recursive ($arr, 'foo')); var_dump (array_walk_recursive ($arr, 'bar')); ?> --EXPECTF-- 1 foo 2 foo 3 foo bool(true) 1 bar 2 bar 3 bar bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php