From: Dmitry Stogov Date: Fri, 28 Oct 2005 09:57:50 +0000 (+0000) Subject: Fixed bug #34982 (array_walk_recursive() modifies elements outside function scope) X-Git-Tag: RELEASE_2_0_1~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44e9370026fb5eace7d40595fa1dc1cab5f72bfc;p=php Fixed bug #34982 (array_walk_recursive() modifies elements outside function scope) --- diff --git a/ext/standard/array.c b/ext/standard/array.c index a5ec285b85..a2ef5c21c4 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1091,7 +1091,8 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive while (!EG(exception) && zend_hash_get_current_data_ex(target_hash, (void **)&args[0], &pos) == SUCCESS) { if (recursive && Z_TYPE_PP(args[0]) == IS_ARRAY) { HashTable *thash; - + + SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]); thash = HASH_OF(*(args[0])); if (thash == target_hash) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");