← All docs

array_push()

Pushes one or more elements onto the end of array.

array_push()

function array_push(array $array, ...$values): void

Pushes one or more elements onto the end of array.

Parameters:

  • $array (array), passed by reference
  • ...$values — variadic: collects excess arguments into $values.

Returns: void

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how array_push is implemented in the compiler, see the internals page.