diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b8c984a8bfc38..1e7a4a276cb8a 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6219,7 +6219,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_reflection_function___construct, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_function_invoke, 0, 0, 0) - ZEND_ARG_INFO(0, args) + ZEND_ARG_VARIADIC_INFO(0, args) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_reflection_function_invokeArgs, 0) @@ -6299,7 +6299,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invoke, 0) ZEND_ARG_INFO(0, object) - ZEND_ARG_INFO(0, args) + ZEND_ARG_VARIADIC_INFO(0, args) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invokeArgs, 0) diff --git a/ext/reflection/tests/bug74421.phpt b/ext/reflection/tests/bug74421.phpt new file mode 100644 index 0000000000000..e549cc2ac48ef --- /dev/null +++ b/ext/reflection/tests/bug74421.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #74421 Wrong reflection on ReflectionFunction::invoke +--FILE-- +isVariadic()); +var_dump($rf->getParameters()[0]->isVariadic()); + +$rm = new ReflectionMethod(ReflectionMethod::class, 'invoke'); +var_dump($rm->isVariadic()); +var_dump($rm->getParameters()[1]->isVariadic()); +?> +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true)