---
title: "Stack & Queue"
description: "Push, pop, shift, and unshift operations."
canonical_url: "https://www.zeyos.com/ixml/ixml-guide/data-types/arrays/stack-queue"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ixml-guide/data-types/arrays/stack-queue.md"
section: "ixml-guide"
authority: "guide"
language: "en"
source_repository: "zeyos/guide"
source_path: "docs/ixml/02-data-types/arrays/stack-queue.md"
source_revision: "cce886a8da98cd124ee3644711085bbdcf1a87ce"
---

# Stack and Queue Operations

:::warning Destructive
These operations modify the array in-place.
:::

## `array:push` — Append item

[Full reference →](https://www.zeyos.com/ixml/ref/array-push)

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 →](https://www.zeyos.com/ixml/ref/array-pop)

Removes and returns the last item (LIFO).

### Syntax

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

---

## `array:shift` — Shift item

[Full reference →](https://www.zeyos.com/ixml/ref/array-shift)

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 →](https://www.zeyos.com/ixml/ref/array-unshift)

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

### Syntax

```xml
<array:unshift var="arrayName">value</array:unshift>
```
