From ca48bd6577caf906edfebbc55675a67b02d140d3 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 7 Oct 2020 15:28:09 +0200 Subject: [PATCH 1/2] don't display default value for variadic --- ext/reflection/php_reflection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 0bc4509d5ee5a..7adcfc506a996 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 From 3abab144e34cf90cb5904537b00c11e3fbafab72 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 7 Oct 2020 15:33:37 +0200 Subject: [PATCH 2/2] fix test --- ext/reflection/tests/ReflectionClass_toString_001.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt index 13b6130a407e2..5dc9d2aa77160 100644 --- a/ext/reflection/tests/ReflectionClass_toString_001.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt @@ -261,7 +261,7 @@ Class [ class ReflectionClass implements Reflector, String Method [ public method newInstance ] { - Parameters [1] { - Parameter #0 [ mixed ...$args = ] + Parameter #0 [ mixed ...$args ] } }