1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/the-spread-syntax-understands-named-parameters-and-correctly-assigns-array-values-to-them.md
2022-04-17 20:03:34 +02:00

623 B

title tweet_id thread_slug author_username images created_at slug
The spread syntax understands named parameters and correctly assigns array values to them 1515057384204382208 weekly-thread-2022-15 SteveTheBauman
https://pbs.twimg.com/media/FQJ4FUcX0A01ZUZ.jpg
2022-04-15T20:00:03+00:00 the-spread-syntax-understands-named-parameters-and-correctly-assigns-array-values-to-them

Today I learned that PHP will insert callback parameters in the order of their defined name, when spreading an array of args with string keys, allowing you to place them in any position in the callback. Super cool! 💪