← All docs

array_unshift() — internals

Compiler internals for array_unshift(): lowering path, type checks, and runtime helpers.

array_unshift() — internals

Where it lives

Lowering notes

  • Lowers array_unshift() by ensuring uniqueness, prepending one scalar value, and returning count.

Runtime helpers

No direct __rt_* helpers captured — the lowering is inlined or routes through another builtin.

Signature summary

function array_unshift(array $array, ...$values): int

What the type checker enforces

  • Arity: takes exactly 1 argument.
  • By-reference parameters: $array.
  • Variadic: collects excess arguments into $values.

Eval interpreter (magician)

Cross-references