News for hackers. Stuff that matters.
Re:PHP 8.5 Adds Pipe Operator: What it means by layer8 on Tuesday August 05, 2025 @09:41AM (#44797856)
I completely agree about intermediate variables (and with explicit type annotations in a typed language) to make the code more intelligible.

But maybe also, the pipe syntax would be better as:

    $arr
    |> fn($x) => array_column($x, 'values')
    |> fn($x) => array_merge(...$x)
    |> fn($x) => array_reduce($x, fn($carry, $item) => $carry + $item, 0)
    |> fn($x) => str_repeat('x', $x)
    |= $result;

There are no comments on this comment yet.