mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 17:27:30 +00:00
@- Updated array_walk() to be able to accept array($obj, 'method')
@ syntax for the walk function. (Andrei)
This commit is contained in:
1 parent
207814916d
commit
d89c5b231c
1 file changed
+9
-2
@@ -1015,11 +1015,18 @@ PHP_FUNCTION(array_walk) {
|
||||
}
|
||||
target_hash = HASH_OF(*array);
|
||||
if (!target_hash) {
|
||||
php_error(E_WARNING, "Wrong datatype in array_walk() call");
|
||||
php_error(E_WARNING, "Wrong datatype in %s() call",
|
||||
get_active_function_name());
|
||||
BG(array_walk_func_name) = old_walk_func_name;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (Z_TYPE_PP(BG(array_walk_func_name)) != IS_ARRAY &&
|
||||
Z_TYPE_PP(BG(array_walk_func_name)) != IS_STRING) {
|
||||
php_error(E_WARNING, "Wrong syntax for function name in %s() call",
|
||||
get_active_function_name());
|
||||
BG(array_walk_func_name) = old_walk_func_name;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_string_ex(BG(array_walk_func_name));
|
||||
php_array_walk(target_hash, userdata);
|
||||
BG(array_walk_func_name) = old_walk_func_name;
|
||||
RETURN_TRUE;
|
||||
|
||||
Reference in new issue
Block a user