When looking at recent changes in the Laravel framework, I saw some PHP syntax that I didn't see before. Because I've been working with PHP for over 20 years and have a firm grasp of the language, I was surprised to see new syntax for the first time.

You might have seen the... operator (aka the spread or splat operator) in various other contexts.

collect(['a' 'b', 'c']) ->map(function($letter) { return strtoupper($letter); }); Using the first-class callable syntax, you can rewrite that code like this.

If you want to know more about this syntax, check out https://php.watch/versions/8.1/first-class-callable-syntax, which also lists the limitations and edge cases.
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