# Arrays

> Section in “New and Extended Functionality” 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/>

## In this section

- [Short List Syntax](https://php7explained.com/new-and-extended-functionality/arrays/short-list-syntax/index.html.md): As of PHP 7.1, the short [] notation can be used instead of list() to unpack array elements into variables, mirroring the short array syntax of PHP 5.4.
- [list() and the ArrayAccess Interface](https://php7explained.com/new-and-extended-functionality/arrays/list-and-the-arrayaccess-interface/index.html.md): PHP 7 lets the list() statement unpack objects of classes that implement the ArrayAccess interface, such as ArrayObject, where older versions gave null.
- [Specifying Keys in list()](https://php7explained.com/new-and-extended-functionality/arrays/specifying-keys-in-list/index.html.md): PHP 7.1 allows keys to be specified when unpacking arrays with list() or its [] short form; any expression, such as a constant or variable, can be a key.
- [list() and References](https://php7explained.com/new-and-extended-functionality/arrays/list-and-references/index.html.md): Since PHP 7.3, the list() statement and its [] short form can be used with reference assignments, so array elements can be destructured by reference.
- [The array_column() Function](https://php7explained.com/new-and-extended-functionality/arrays/the-array_column-function/index.html.md): In PHP 7, array_column() also works on a one-dimensional array of objects, reading public properties or private ones exposed via __isset() and __get().
- [array_merge() and array_merge_recursive()](https://php7explained.com/new-and-extended-functionality/arrays/array_merge-and-array_merge_recursive/index.html.md): array_merge() and array_merge_recursive() can now be called without an argument and return an empty array, which helps when spreading an empty list.
- [array_push() and array_unshift()](https://php7explained.com/new-and-extended-functionality/arrays/array_push-and-array_unshift/index.html.md): array_push() and array_unshift() can now be called with only the array as single argument, useful when the spread operator unpacks an empty list of values.
- [array_key_first() and array_key_last()](https://php7explained.com/new-and-extended-functionality/arrays/array_key_first-and-array_key_last/index.html.md): PHP 7.3 introduces the array_key_first() and array_key_last() functions, which return the first and the last key of an array, respectively.
- [Spread Operator in Array Expressions](https://php7explained.com/new-and-extended-functionality/arrays/spread-operator-in-array-expressions/index.html.md): Since PHP 7.4, the spread operator ... can be used inside array expressions to unpack index-based arrays; unpacking by reference is not possible.

---

Previous: [Negative String Offsets](https://php7explained.com/new-and-extended-functionality/strings/negative-string-offsets/index.html.md) | Next: [Short List Syntax](https://php7explained.com/new-and-extended-functionality/arrays/short-list-syntax/index.html.md)
