Index: php4/ext/standard/basic_functions.c
===================================================================
RCS file: /repository/php4/ext/standard/basic_functions.c,v
retrieving revision 1.276
diff -r1.276 basic_functions.c
324a326
> PHP_FE(call_user_func_with_array, NULL)
1523a1527,1564
>
> /* {{{ proto mixed call_user_func_with_array(string function_name, array parameters)
> Call a user function which is the first parameter with the arguments contained in array */
> PHP_FUNCTION(call_user_func_with_array)
> {
> zval **func_name,
> **params,
> ***func_args = NULL,
> *retval_ptr;
> HashTable *params_ar;
> int num_elems,
> element = 0;
>
> if (ZEND_NUM_ARGS() != 2 ||
> zend_get_parameters_ex(2, &func_name, ¶ms) == FAILURE) {
> WRONG_PARAM_COUNT;
> }
> convert_to_string_ex(func_name);
>
> params_ar = HASH_OF(*params);
> num_elems = zend_hash_num_elements(params_ar);
>
> func_args = (zval ***)emalloc(sizeof(zval **) * num_elems);
>
> for (zend_hash_internal_pointer_reset(params_ar);
> zend_hash_get_current_data(params_ar, (void **)&(func_args[element])) == SUCCESS;
> zend_hash_move_forward(params_ar))
> element++;
>
> if (call_user_function_ex(CG(function_table), NULL, *func_name, &retval_ptr, num_elems, func_args, 1, NULL) == SUCCESS
> && retval_ptr) {
> COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
> } else {
> php_error(E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_PP(func_name));
> }
>
> efree(func_args);
> }
> /* }}} */
>
Index: php4/ext/standard/basic_functions.h
===================================================================
RCS file: /repository/php4/ext/standard/basic_functions.h,v
retrieving revision 1.67
diff -r1.67 basic_functions.h
80a81
> PHP_FUNCTION(call_user_func_with_array);

