You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NestedFuncCallsToPipeOperatorRector breaks spread operator in input #9710
// input code$arrayOfArrays = [['a'], ['a'], ['b']];
$merged = array_unique(array_merge(...$arrayOfArrays));
var_dump($merged); // ['a', 'b']// this is what rector does$merged = $arrayOfArrays
|> array_merge(...) // results in no change, instead of arrays being merged together as in original
|> array_unique(...); // warning var_dump($merged); // ->different! [['a']]// this is what rector should do$merged = array_merge(...$arrayOfArrays)
|> array_unique(...);
var_dump($merged); // -> same as original code: ['a', 'b']
Activity
TomasVotruba commentedon Mar 26, 2026
Thank you for your report and demo link!
We'll need a failing test case in a pull-request, so we have it covered in Rector.
You can click "Create a Test" button at demo page.
annadamm-check24 commentedon Mar 27, 2026
here it is: rectorphp/rector-src#7936
github-actions commentedon Aug 30, 2026
This issue has been automatically locked because it has been closed for 150 days. Please open a new issue if you have a similar problem.