" too few arguments to function `call_user_function_ex'"
| From: | Leon Mergen | Date: | Wed, 25 Dec 2002 14:16:04 +0000 |
| Subject: | " too few arguments to function `call_user_function_ex'" | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-92819@lists.php.net to get a copy of this message | ||
Hello,
Tought this was the best newsgroup to post to, since I'm developing an
in-house only additional PHP module.
Anyway, I want to call a user function from a function in my module... so I
should use call_user_function_ex . Well, I tried the example on the website,
and it gives me the error:
antrophia.c: In function `zif_antrophia_msgincrease':
antrophia.c:147: too few arguments to function `call_user_function_ex'
I have pasted the source of that function below... anyone has any idea what
I am doing wrong? (and again, I am sorry if this is the wrong group)
Thanks in advance.
Regards,
Leon Mergen
--- source
PHP_FUNCTION(antrophia_msgincrease)
{
zval *rtrn;
zval **function_name;
if((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &function_name) !=
SUCCESS))
{
WRONG_PARAM_COUNT;
}
if((*function_name)->type != IS_STRING)
{
zend_error(E_ERROR, "Function requires string argument");
}
// Introduce compiler globals (CG) to this function
TSRMLS_FETCH();
if(call_user_function_ex(CG(function_table), NULL, *function_name, &rtrn,
0, NULL, 0) != SUCCESS)
{
zend_error(E_ERROR, "Function call failed");
}
zend_printf("We have %i as type<br>", rtrn->type);
*return_value = *rtrn;
zval_copy_ctor(return_value);
zval_ptr_dtor(&rtrn);
}