# `list()` and References

> Section in “New and Extended Functionality › Arrays” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/new-and-extended-functionality/arrays/list-and-references/>

Prior to PHP 7.3, it was not possible to use the `list()` statement, as well as its `[]` short form, with reference assignments.

``` php
$a     = 1;
$b     = 1;
$array = [$a, &$b];

$c = $array[0];
$d = &$array[1];

$b++;

var_dump($c);
var_dump($d);
```

Executing the code shown above prints the output shown below:

    int(1)
    int(2)

With PHP 7.3 and later, the array deconstruction can be expressed like so:

``` php
[$c, &$d] = $array;
```

Of course, the following also works:

``` php
list($c, &$d) = $array;
```

---

Previous: [Specifying Keys in list()](https://php7explained.com/new-and-extended-functionality/arrays/specifying-keys-in-list/index.html.md) | Next: [The array_column() Function](https://php7explained.com/new-and-extended-functionality/arrays/the-array_column-function/index.html.md)
