Skip to content

Commit 91f47ee

Browse files
committed
don't display default value for variadic
1 parent fd81e70 commit 91f47ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/reflection/php_reflection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ static void _parameter_string(smart_str *str, zend_function *fptr, struct _zend_
674674
smart_str_append_printf(str, "$%s", has_internal_arg_info(fptr)
675675
? ((zend_internal_arg_info*)arg_info)->name : ZSTR_VAL(arg_info->name));
676676

677-
if (!required) {
677+
if (!required && !ZEND_ARG_IS_VARIADIC(arg_info)) {
678678
if (fptr->type == ZEND_INTERNAL_FUNCTION) {
679679
smart_str_appends(str, " = ");
680680
/* TODO: We don't have a way to fetch the default value for an internal function

ext/reflection/tests/ReflectionClass_toString_001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector, String
261261
Method [ <internal:Reflection> public method newInstance ] {
262262

263263
- Parameters [1] {
264-
Parameter #0 [ <optional> mixed ...$args = <default> ]
264+
Parameter #0 [ <optional> mixed ...$args ]
265265
}
266266
}
267267

0 commit comments

Comments
 (0)