Thanks for your feedback. 🙏 You are absolutely right. The spread operator is a more readable alternative for array_merge, if you are working with array literals.
⚠️ In all current PHP versions (up to 8.0) the spread operator does not work for arrays with string keys.
have you tried this?
Thanks for your feedback. 🙏 You are absolutely right. The spread operator is a more readable alternative for
array_merge
, if you are working with array literals.⚠️ In all current PHP versions (up to 8.0) the spread operator does not work for arrays with string keys.
But that will change in PHP 8.1 . 🎉🎉🎉
Then it's effectively an
array_merge
alternative for array literals.