cvs: php4 /ext/standard array.c
| From: | Andrei Zmievski | Date: | Tue, 22 Aug 2000 18:39:29 +0000 |
| Subject: | cvs: php4 /ext/standard array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1328@lists.php.net to get a copy of this message | ||
andrei Tue Aug 22 11:39:29 2000 EDT
Modified files:
/php4/ext/standard array.c
Log:
@- Updated array_walk() to be able to accept array($obj, 'method')
@ syntax for the walk function. (Andrei)
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.70 php4/ext/standard/array.c:1.71
--- php4/ext/standard/array.c:1.70 Fri Aug 18 05:45:01 2000
+++ php4/ext/standard/array.c Tue Aug 22 11:39:29 2000
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.70 2000/08/18 12:45:01 hholzgra Exp $ */
+/* $Id: array.c,v 1.71 2000/08/22 18:39:29 andrei Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -1015,11 +1015,18 @@
}
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;