PHP 7.1 – Symmetric array destructuring

In this post, I will show you how you can use the new Symmetric array destructuring feature of PHP7.1 version. In the previous version of PHP, we used list method to destructure arrays for assignments.

The shorthand array syntax ([]) may now be used to destructure arrays for assignments (Including within foreach), as an alternative to the existing list() syntax, which is still supported.

Symmetric array destructuring

Symmetric array destructuring within foreach

With named keys

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments Protection Status
Would love your thoughts, please comment.x