shift.php
Table of Contents
Functions
- shift() : string
- Remove the first element of an array.
Functions
shift()
Remove the first element of an array.
shift(mixed $anyArray) : string
This helper wraps the ArangoDB AQL function SHIFT(anyArray) which removes
and returns the first element of an array, modifying the original array.
If the array is empty, it returns null.
Example AQL usage:
SHIFT([1, 2, 3]) // returns 1, array becomes [2, 3]
SHIFT(doc.items) // removes first item from doc.items
SHIFT([]) // returns null
Parameters
- $anyArray : mixed
-
Array expression to remove first element from.
Tags
Return values
string —The formatted AQL expression.