From 3097d8141af42eec35de805019426a9f06aef364 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Wed, 6 Feb 2019 23:31:24 -0200 Subject: [PATCH 1/2] Fix variadic arginfos for Reflection functions --- ext/reflection/php_reflection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index f834c947e6fb..74118f601fc5 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6181,7 +6181,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) @@ -6261,7 +6261,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) @@ -6356,7 +6356,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_isInstance, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_newInstance, 0) - ZEND_ARG_INFO(0, args) + ZEND_ARG_VARIADIC_INFO(0, args) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_newInstanceWithoutConstructor, 0) From 7ff3d415dc9d7cddc297654f446751d4a64afb9c Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sun, 12 Aug 2018 23:15:42 -0300 Subject: [PATCH 2/2] Fix arginfos of required arguments for some Reflection methods --- ext/reflection/php_reflection.c | 8 ++++---- ext/reflection/tests/ReflectionClass_toString_001.phpt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 74118f601fc5..e02537312264 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3174,7 +3174,7 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic) } /* }}} */ -/* {{{ proto public mixed ReflectionMethod::invoke(mixed object, mixed* args) +/* {{{ proto public mixed ReflectionMethod::invoke(mixed object, [mixed* args]) Invokes the method. */ ZEND_METHOD(reflection_method, invoke) { @@ -4597,7 +4597,7 @@ ZEND_METHOD(reflection_class, isInstance) } /* }}} */ -/* {{{ proto public stdclass ReflectionClass::newInstance(mixed* args, ...) +/* {{{ proto public stdclass ReflectionClass::newInstance([mixed* args], ...) Returns an instance of this class */ ZEND_METHOD(reflection_class, newInstance) { @@ -6259,7 +6259,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_method___construct, 0, 0, 1) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invoke, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_method_invoke, 0, 0, 1) ZEND_ARG_INFO(0, object) ZEND_ARG_VARIADIC_INFO(0, args) ZEND_END_ARG_INFO() @@ -6355,7 +6355,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_isInstance, 0) ZEND_ARG_INFO(0, object) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_newInstance, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_class_newInstance, 0, 0, 0) ZEND_ARG_VARIADIC_INFO(0, args) ZEND_END_ARG_INFO() diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt index e97af14110be..6875ff300a8c 100644 --- a/ext/reflection/tests/ReflectionClass_toString_001.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt @@ -265,7 +265,7 @@ Class [ class ReflectionClass implements Reflector ] { Method [ public method newInstance ] { - Parameters [1] { - Parameter #0 [ $args ] + Parameter #0 [ ...$args ] } }