ksort()
function ksort(array $array, int $flags = 0): bool
Sorts an array by key in ascending order, comparing keys under $flags.
Parameters:
$array(array), passed by reference$flags(int), default0, optional
Returns: bool
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported through a declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/array/ksort.rs).
No examples yet. Check examples/ and showcases/ for usage patterns.
Internals
For how ksort is implemented in the compiler, see the internals page.