bug #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
This commit is contained in:
commit
4299dae7c0
@ -125,12 +125,12 @@ class ReflectionCaster
|
||||
|
||||
foreach ($c->getParameters() as $v) {
|
||||
$k = '$'.$v->name;
|
||||
if ($v->isPassedByReference()) {
|
||||
$k = '&'.$k;
|
||||
}
|
||||
if (method_exists($v, 'isVariadic') && $v->isVariadic()) {
|
||||
$k = '...'.$k;
|
||||
}
|
||||
if ($v->isPassedByReference()) {
|
||||
$k = '&'.$k;
|
||||
}
|
||||
$a[$prefix.'parameters'][$k] = $v;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user