mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
MFH: Fixed bug #48757 (ReflectionFunction::invoke() parameter issues)
This commit is contained in:
parent
b6bd0f6806
commit
21d61978dc
@ -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, "+", ¶ms, &num_args) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", ¶ms, &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()
|
||||
|
||||
|
21
ext/reflection/tests/bug48757.phpt
Normal file
21
ext/reflection/tests/bug48757.phpt
Normal 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"
|
Loading…
Reference in New Issue
Block a user