Source: 63edb91e46663800083d0ea0--sebastiandedeyne-com-e11d52.netlify.app

PHP wishlist: The pipe operator
Well, the pipe operator |> is mine. I’d like to expand on why I think the pipe operator would be a valuable addition to the language from a PHP developer’s perspective.

// This is the same as `sum(1, 2)` 1 |> sum(2); Adding the pipe operator to PHP isn’t a new idea.

) ->take(5) ->toArray(); With the pipe operator, User:all() could return an array and work with a set of array functions.

DateTime::now() |> isFuture(); With the pipe operator, we get the ergonomics of boxed objects, without the overhead of wrapping & unwrapping them.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners