From: Kalle Sommer Nielsen Date: Wed, 1 Jul 2009 17:37:42 +0000 (+0000) Subject: Fixed bug #48757 (ReflectionFunction::invoke() parameter issues) X-Git-Tag: php-5.4.0alpha1~191^2~3194 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f3fb7ec31adbffe86c61906f4db03bbc8957374;p=php Fixed bug #48757 (ReflectionFunction::invoke() parameter issues) --- diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8c586cf752..c22583b80c 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1763,7 +1763,7 @@ ZEND_METHOD(reflection_function, getClosure) } /* }}} */ -/* {{{ proto public mixed ReflectionFunction::invoke(mixed* args) U +/* {{{ proto public mixed ReflectionFunction::invoke([mixed* args]) U Invokes the function */ ZEND_METHOD(reflection_function, invoke) { @@ -1778,7 +1778,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, "+", ¶ms, &num_args) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", ¶ms, &num_args) == FAILURE) { return; } @@ -5249,7 +5249,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() diff --git a/ext/reflection/tests/bug48757.phpt b/ext/reflection/tests/bug48757.phpt new file mode 100644 index 0000000000..939349fb0e --- /dev/null +++ b/ext/reflection/tests/bug48757.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #48757 (ReflectionFunction::invoke() parameter issues) +--FILE-- +invoke(); + +$func = new ReflectionFunction('another_test'); +$func->invoke('testing'); +?> +--EXPECT-- +Hello World +unicode(7) "testing"