From: Antony Dovgal Date: Fri, 3 Dec 2004 17:43:23 +0000 (+0000) Subject: fix array_walk_recursive() so it doesn't reuse cached fci between calls X-Git-Tag: RELEASE_0_2~583 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6b8bf00108703bea2ef0476f53493c77c05f488;p=php fix array_walk_recursive() so it doesn't reuse cached fci between calls and add test for it --- diff --git a/ext/standard/array.c b/ext/standard/array.c index e317303348..4368f2d91f 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1157,6 +1157,8 @@ PHP_FUNCTION(array_walk_recursive) 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; diff --git a/ext/standard/tests/array/array_walk_recursive.phpt b/ext/standard/tests/array/array_walk_recursive.phpt new file mode 100644 index 0000000000..c3b37c321c --- /dev/null +++ b/ext/standard/tests/array/array_walk_recursive.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test array_walk_recursive() +--FILE-- + +--EXPECTF-- +1 foo +2 foo +3 foo +bool(true) +1 bar +2 bar +3 bar +bool(true)