Re:PHP 8.5 alpha 1 is available for download
by moebrowne on Wednesday July 09, 2025 @09:49AM
(#44510034)
There is a complementary Partial Function Application RFC which, among other things, solves the one-parameter limitation. It allows a question mark to be substituted in for the piped value:
$foo |> str_replace('hello', 'hi', ?);
Obligatory: Raku supports pipe in both directions, passing input as the last parameter instead of requiring the function to take only one parameter. It also has a shorthand:
my @array = <7 8 9 0 1 2 4 3 5 6 7 8 9>; my @final-array = @array.unique.sort.reverse; say @final-array;