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), defaultfalse, optional
Returns: array
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/array/array_reverse.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how array_reverse is implemented in the compiler, see the internals page.