diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-02-03 18:30:40 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-02-03 18:30:40 +0100 |
commit | 6303dd1ea44255ea121858bb23563d803696cca8 (patch) | |
tree | dba463416bcba5444c5f5bdb9a393633efec6e0b /ext/reflection | |
parent | 5537a4e2b8b426336e600d833de2ba61bc7b44ef (diff) | |
parent | 57817eb72f8aaf44c49aad75ed68e5335f444e7e (diff) | |
download | php-git-6303dd1ea44255ea121858bb23563d803696cca8.tar.gz |
Merge branch 'PHP-7.1'
Diffstat (limited to 'ext/reflection')
-rw-r--r-- | ext/reflection/php_reflection.c | 6 | ||||
-rw-r--r-- | ext/reflection/tests/ReflectionClass_toString_001.phpt | 2 | ||||
-rw-r--r-- | ext/reflection/tests/bug74035.phpt | 11 |
3 files changed, 15 insertions, 4 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b0fad2a40a..b7c793c4b1 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4690,7 +4690,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) { @@ -6388,8 +6388,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 29d58420e3..2b185db57d 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 ] } } diff --git a/ext/reflection/tests/bug74035.phpt b/ext/reflection/tests/bug74035.phpt new file mode 100644 index 0000000000..74cf03f5e5 --- /dev/null +++ b/ext/reflection/tests/bug74035.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #74035: getNumberOfRequiredParameters wrong for ReflectionClass::newInstance +--FILE-- +<?php +$r = new ReflectionClass(ReflectionClass::class); +$m = $r->getMethod('newInstance'); + +echo $m->getNumberOfRequiredParameters(); +?> +--EXPECT-- +0 |