com php-src: Fix variadic arginfos for Reflection functions: UPGRADING ext/reflection/php_reflection.c ext/reflection/tests/Refl
ectionClass_toString_001.phpt

From: Date: Sun, 10 Feb 2019 16:29:08 +0000
Subject: com php-src: Fix variadic arginfos for Reflection functions: UPGRADING ext/reflection/php_reflection.c ext/reflection/tests/Refl
ectionClass_toString_001.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-104510@lists.php.net to get a copy of this message
Commit: 35db1ccdd1f0f2079875e2e72c22acea439cd49e Author: Gabriel Caruso <carusogabriel34@gmail.com> Wed, 6 Feb 2019 23:31:24 -0200 Parents: 35980191d2119125e5a4665ae1a049c4840b9e54 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=35db1ccdd1f0f2079875e2e72c22acea439cd49e Log: Fix variadic arginfos for Reflection functions Fix arginfos of required arguments for some Reflection methods Changed paths: M UPGRADING M ext/reflection/php_reflection.c M ext/reflection/tests/ReflectionClass_toString_001.phpt Diff: diff --git a/UPGRADING b/UPGRADING index 9985565..2942c64 100644 --- a/UPGRADING +++ b/UPGRADING @@ -105,6 +105,16 @@ PHP 8.0 UPGRADE NOTES as a string instead of an ASCII codepoint. The previous behavior may be restored with an explicit call to chr(). +- Reflection: + . The following methods signatures have been changed: + + * ReflectionClass::newInstance(mixed $args) -> ReflectionClass::newInstance([mixed ...$args]) + * ReflectionFunction::invoke(mixed $args) -> ReflectionFunction::invoke(mixed ...$args) + * ReflectionMethod::invoke(object $object, mixed $args) -> ReflectionMethod::invoke(object $object [, mixed ...$args]) + + Inheriting classes implementing this method will now have to use + a compatible method signature. + - SPL: . SplFileObject::fgetss() has been removed. . SplHeap::compare($a, $b) now specifies a method signature. Inheriting diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index f834c94..e025373 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) { @@ -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) @@ -6259,9 +6259,9 @@ 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_INFO(0, args) + ZEND_ARG_VARIADIC_INFO(0, args) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invokeArgs, 0) @@ -6355,8 +6355,8 @@ 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_ARG_INFO(0, args) +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_class_newInstance, 0, 0, 0) + ZEND_ARG_VARIADIC_INFO(0, args) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_newInstanceWithoutConstructor, 0) diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt index e97af14..6875ff3 100644 --- a/ext/reflection/tests/ReflectionClass_toString_001.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt @@ -265,7 +265,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] { Method [ <internal:Reflection> public method newInstance ] { - Parameters [1] { - Parameter #0 [ <required> $args ] + Parameter #0 [ <optional> ...$args ] } }

« previous php.cvs (#104510) next »