Stack and Queue Operations
Destructive
These operations modify the array in-place.
array:push — Append item
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
Removes and returns the last item (LIFO).
Syntax
XML
<array:pop var="arrayName" var_result="resultVar" />
array:shift — Shift item
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
Prepends a value to the beginning of an array. Numeric keys are re-indexed.
Syntax
XML
<array:unshift var="arrayName">value</array:unshift>