← All docs
is_scalar() — internals
Compiler internals for is_scalar(): lowering path, type checks, and runtime helpers.
is_scalar() — internals
Where it lives
- Signature:
src/builtins/types/is_scalar.rs - Lowering:
src/codegen/lower_inst/builtins.rs:1652 (lower_is_scalar) - Function symbol:
lower_is_scalar()
Lowering notes
- Lowers
is_scalar(): true for int/float/string/bool, a non-null tagged scalar, or a boxed - Mixed/Union value whose runtime tag is int (0), string (1), float (2), or bool (3). Null,
- arrays, objects, and resources are not scalars, matching PHP.
Runtime helpers
No direct __rt_* helpers captured — the lowering is inlined or routes through another builtin.
Signature summary
function is_scalar(mixed $value): bool
What the type checker enforces
- Arity: takes exactly 1 argument.
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/types/is_scalar.rs(eval_builtin!) - Dispatch hooks:
direct,values