array:tail

Returns an array containing all members except the first from a supplied array.

Signature

array:tail($array as array(*)) as array(*)

Properties

This function is deterministic, context-independent, and focus-independent.

Rules

The function returns an array containing all members of the supplied array except the first, that is array:remove($array, 1).

Error Conditions

A dynamic error occurs [ERRFOAY0001] if $array is empty.

Notes

If the supplied array contains exactly one member, the result will be an empty array.

Examples

The expression array:tail([5, 6, 7, 8]) returns [6, 7, 8].

The expression array:tail([5]) returns [ ].