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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners