The great thing about this pipe operator is that it accepts any callable expression. I’m writing a library to make these array and string functions more expressive.
For example, in php 8.5 you’ll be able to do:
[1,1,2,3,2] |> unique
And then define “unique” as a constant with a callback assigned to it, roughly like:
I'm thinking of something like this:
which then can be in the following way: Or if we just created an alias for then #then method: then it can be used like in this way: