Skip to main content

Stack and Queue Operations

Destructive

These operations modify the array in-place.

array:push — Append item

Full reference →

Appends a value to the end of an array. Equivalent to $var[] = value.

Syntax

XML
<array:push var="arrayName">value</array:push>

array:pop — Pop item

Full reference →

Removes and returns the last item (LIFO).

Syntax

XML
<array:pop var="arrayName" var_result="resultVar" />

array:shift — Shift item

Full reference →

Removes and returns the first item (FIFO). Numeric keys are re-indexed.

Syntax

XML
<array:shift var="arrayName" var_result="resultVar" />

array:unshift — Prepend item

Full reference →

Prepends a value to the beginning of an array. Numeric keys are re-indexed.

Syntax

XML
<array:unshift var="arrayName">value</array:unshift>