MFH: Fixed bug #48757 (ReflectionFunction::invoke() parameter issues)

This commit is contained in:
Kalle Sommer Nielsen 2009-07-01 17:38:03 +00:00
parent b6bd0f6806
commit 21d61978dc
2 changed files with 24 additions and 3 deletions

View File

@ -1717,7 +1717,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
}
/* }}} */
/* {{{ proto public mixed ReflectionFunction::invoke(mixed* args)
/* {{{ proto public mixed ReflectionFunction::invoke([mixed* args])
Invokes the function */
ZEND_METHOD(reflection_function, invoke)
{
@ -1732,7 +1732,7 @@ ZEND_METHOD(reflection_function, invoke)
METHOD_NOTSTATIC(reflection_function_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &params, &num_args) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &params, &num_args) == FAILURE) {
return;
}
@ -5008,7 +5008,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_reflection_function___construct, 0)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_reflection_function_invoke, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_function_invoke, 0, 0, 0)
ZEND_ARG_INFO(0, args)
ZEND_END_ARG_INFO()

View File

@ -0,0 +1,21 @@
--TEST--
Bug #48757 (ReflectionFunction::invoke() parameter issues)
--FILE--
<?php
function test() {
echo "Hello World\n";
}
function another_test($parameter) {
var_dump($parameter);
}
$func = new ReflectionFunction('test');
$func->invoke();
$func = new ReflectionFunction('another_test');
$func->invoke('testing');
?>
--EXPECT--
Hello World
string(7) "testing"