← All docs

array_push()

Pushes one or more elements onto the end of array.

array_push()

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

Pushes one or more elements onto the end of array.

Parameters:

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

Returns: int

Availability

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

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