Skip to main content

Shift off array

Anatomy

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

Description: ARRAY:SHIFT shifts an item off the beginning of an array and returns its value.

Attention:

ARRAY:SHIFT is destructive, in the sense that it modifies the array in-place. It will re-index all numeric keys in the array.

Attributes

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

Results:

BindingTypePredicate
vararrayno-result-propagation
var_resultN/A

Examples

Example

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

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

<!-- Bill Gates -->