When I look at the new pipe syntax ... $output = $input |> trim(...) |> (fn (string $string) => str_replace(' ', '-', $string)) |> (fn (string $string) => str_replace(['.', '/', '…'], '', $string)) |> strtolower(...); ... I think why not just something like the following? $output = $input |> trim($) |> str_replace(' ', '-', $) |> str_replace(['.', '/', '…'], '', $) |> strtolower($);
As for the partial function application, there is already an RFC to add that, but it's not decided on as of now. [2]
1: https://www.php.net/manual/en/functions.first_class_callable...