Destructuring arrays using list

suggest change

Use list() to quick assign a list of variable values into an array. See also compact()

// Assigns to $a, $b and $c the values of their respective array elements in           $array with keys numbered from zero
list($a, $b, $c) = $array;

With PHP 7.1 (currently in beta) you will be able to use short list syntax:

// Assigns to $a, $b and $c the values of their respective array elements in $array with keys numbered from zero
[$a, $b, $c] = $array;
// Assigns to $a, $b and $c the values of the array elements in $array with the keys "a", "b" and "c", respectively
["a" => $a, "b" => $b, "c" => $c] = $array;

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Executing upon an array:
* Destructuring arrays using list

Table Of Contents
2 Arrays
4 Types
10 Cookies
14 JSON
15 SOAP
17 cURL
19 XML
21 Traits
35 UTF-8
36 URLs
38 PHPDoc
41 Loops
44 Closur
72 YAML
77 Cache
78 Streams
81 PDO
82 SQLite3
83 Sockets
87 MongoDB
89 Executing upon an array
93 IMAP
94 Redis
95 Imagick
102 APCu
108 PSR