Skip to main content

Pop off array

Anatomy

<array:pop var="var" var_result="var"/>

Description: ARRAY:POP pops an item off the end of an array and returns its value.

Attention:

ARRAY:POP is destructive, in the sense that it modifies the array in-place. It preserves the key and value associations of the array.

Attributes

NameTypeDescriptionDefined By
varvarVariable name array:pop
var_resultvarResult variable name array:pop

Results:

BindingTypePredicate
vararrayno-result-propagation
var_resultN/A

Examples

Example

<array var="names">
<item>Bill Gates</item>
<item>Steve Jobs</item>
</array>

<output>
<array:pop var="names"/>
</output>

<!-- Steve Jobs -->