summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2020-10-07 16:30:18 +0200
committerRemi Collet <remi@php.net>2020-10-07 16:30:18 +0200
commit91f47ee2633c77f073ee9ea68bb9a28842498304 (patch)
tree975853cf0b7895676761cfbae8bfd71d29fcdfbe
parentfd81e708bcabec63628b78a08fbf94b9bdc5fec6 (diff)
downloadphp-git-91f47ee2633c77f073ee9ea68bb9a28842498304.tar.gz
don't display default value for variadic
-rw-r--r--ext/reflection/php_reflection.c2
-rw-r--r--ext/reflection/tests/ReflectionClass_toString_001.phpt2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 0bc4509d5e..7adcfc506a 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -674,7 +674,7 @@ static void _parameter_string(smart_str *str, zend_function *fptr, struct _zend_
smart_str_append_printf(str, "$%s", has_internal_arg_info(fptr)
? ((zend_internal_arg_info*)arg_info)->name : ZSTR_VAL(arg_info->name));
- if (!required) {
+ if (!required && !ZEND_ARG_IS_VARIADIC(arg_info)) {
if (fptr->type == ZEND_INTERNAL_FUNCTION) {
smart_str_appends(str, " = ");
/* TODO: We don't have a way to fetch the default value for an internal function
diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt
index 13b6130a40..5dc9d2aa77 100644
--- a/ext/reflection/tests/ReflectionClass_toString_001.phpt
+++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt
@@ -261,7 +261,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector, String
Method [ <internal:Reflection> public method newInstance ] {
- Parameters [1] {
- Parameter #0 [ <optional> mixed ...$args = <default> ]
+ Parameter #0 [ <optional> mixed ...$args ]
}
}