← All docs

array_reverse()

Returns an array with the elements in reverse order.

array_reverse()

function array_reverse(array $array, bool $preserve_keys = false): array

Returns an array with the elements in reverse order.

Parameters:

  • $array (array)
  • $preserve_keys (bool), default false, optional

Returns: array

Availability

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

Internals

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