Oihana PHP Arango

pop.php

Table of Contents

Functions

pop()  : string
Remove the last element of array.

Functions

pop()

Remove the last element of array.

pop(mixed $anyArray) : string

This helper wraps the ArangoDB AQL function POP(anyArray) which removes and returns the last element of an array, modifying the original array.

If it’s already empty or has only a single element left, an empty array is returned.

Example AQL usage:

RETURN POP( [ 1, 2, 3, 4 ] )
Parameters
$anyArray : mixed

an array with elements of arbitrary type

Tags
example
use function oihana\arango\db\functions\arrays\pop;

$expr = pop('[1, 2, 3]');
// Produces: 'POP([1, 2, 3])'
see
https://docs.arango.ai/arangodb/stable/aql/functions/array/#pop
since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results