Source: www.amitmerchant.com

Proposed named arguments in PHP 8

Category: PHP, javascript

A blog on PHP, JavaScript and more Amit Merchant · July 10, 2020 · ⋆ PHP Did you ever get in a situation where you’re seeing a function and its parameters and wonders what those parameters are all about?

For instance, take following, Now, the first three parameters passed to array_slice is seemed to be self-explanatory because of informative variable names but what about the fourth parameter?

Well, this can be solved if this RFC is approved in PHP 8 which introduces named parameters.

You can refer to the original RFC (which is still in the voting phase) if you want to take a more in-depth look at named parameters and constraints they comes with.
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