Skip to content

Commit 4299dae

Browse files
bug symfony#20931 [VarDumper] Fix dumping by-ref variadics (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [VarDumper] Fix dumping by-ref variadics | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - The correct php syntax is `&...$foo`, not ~~`...&$foo`~~ Commits ------- 28ec361 [VarDumper] Fix dumping by-ref variadics
2 parents cf9f541 + 28ec361 commit 4299dae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, arra
125125

126126
foreach ($c->getParameters() as $v) {
127127
$k = '$'.$v->name;
128-
if ($v->isPassedByReference()) {
129-
$k = '&'.$k;
130-
}
131128
if (method_exists($v, 'isVariadic') && $v->isVariadic()) {
132129
$k = '...'.$k;
133130
}
131+
if ($v->isPassedByReference()) {
132+
$k = '&'.$k;
133+
}
134134
$a[$prefix.'parameters'][$k] = $v;
135135
}
136136

0 commit comments

Comments
 (0)