array_rand()
function array_rand(array $array): int
Pick one or more random keys out of an array.
Parameters:
$array(array)
Returns: int
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/array/array_rand.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how array_rand is implemented in the compiler, see the internals page.