summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/array.c10
-rw-r--r--ext/standard/basic_functions.c19
2 files changed, 20 insertions, 9 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 0d47ed68e8..82bb9efff8 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -825,12 +825,14 @@ static int php_array_walk(HashTable *target_hash, zval **userdata)
}
/* Call the userland function */
- call_user_function_ex(CG(function_table), NULL, *BG(array_walk_func_name),
- &retval_ptr, userdata ? 3 : 2, args, 0);
+ if (call_user_function_ex(CG(function_table), NULL, *BG(array_walk_func_name),
+ &retval_ptr, userdata ? 3 : 2, args, 0) == SUCCESS) {
- if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
- }
+ } else
+ php_error(E_WARNING,"Unable to call %s() - function does not exist",
+ (*BG(array_walk_func_name))->value.str.val);
+
/* Clean up the key */
if (zend_hash_get_current_key_type(target_hash) == HASH_KEY_IS_STRING)
efree(key->value.str.val);
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 3e70b22f5d..f5c571a21a 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1045,25 +1045,34 @@ PHP_FUNCTION(call_user_method)
void user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry)
{
- pval retval;
int i;
- CLS_FETCH();
- if (call_user_function(CG(function_table), NULL, shutdown_function_entry->arguments[0], &retval, shutdown_function_entry->arg_count-1, shutdown_function_entry->arguments+1)==SUCCESS) {
- pval_destructor(&retval);
- }
for (i=0; i<shutdown_function_entry->arg_count; i++) {
zval_ptr_dtor(&shutdown_function_entry->arguments[i]);
}
efree(shutdown_function_entry->arguments);
}
+int user_shutdown_function_call(php_shutdown_function_entry *shutdown_function_entry)
+{
+ zval retval;
+ CLS_FETCH();
+
+ if (call_user_function(CG(function_table), NULL, shutdown_function_entry->arguments[0], &retval, shutdown_function_entry->arg_count-1, shutdown_function_entry->arguments+1)==SUCCESS) {
+ zval_dtor(&retval);
+ } else
+ php_error(E_WARNING,"Unable to call %s() - function does not exist",
+ shutdown_function_entry->arguments[0]->value.str.val);
+ return 0;
+}
void php_call_shutdown_functions(void)
{
BLS_FETCH();
if (BG(user_shutdown_function_names)) {
+ zend_hash_apply(BG(user_shutdown_function_names),
+ (apply_func_t)user_shutdown_function_call);
zend_hash_destroy(BG(user_shutdown_function_names));
efree(BG(user_shutdown_function_names));
}