← All docs
usort() — internals
Compiler internals for usort(): lowering path, type checks, and runtime helpers.
usort() — internals
Where it lives
- Signature:
src/builtins/array/usort.rs - Lowering:
src/codegen/lower_inst/builtins/arrays.rs:1124 (lower_usort) - Function symbol:
lower_usort()
Lowering notes
- Lowers
usort()for indexed integer arrays with a static user comparator.
Runtime helpers
The following runtime helpers are referenced:
__rt_array_is_list
Signature summary
function usort(array $array, callable $callback): bool
What the type checker enforces
- Arity: takes exactly 2 arguments.
- By-reference parameters:
$array.
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/array/usort.rs(eval_builtin!) - Dispatch hooks:
values - By-reference parameters:
$array.