← All docs
serialize() — internals
Compiler internals for serialize(): lowering path, type checks, and runtime helpers.
serialize() — internals
Where it lives
- Signature:
src/builtins/system/serialize.rs - Lowering:
src/codegen/lower_inst/builtins/serialize.rs:33 (lower_serialize) - Function symbol:
lower_serialize()
Lowering notes
- Lowers
serialize($value)into the shared serialize runtime helper. - Scalar static types are formatted directly through
__rt_serialize_value; a - Mixed/Union argument is unboxed and dispatched by
__rt_serialize_mixed. - Non-scalar static types (arrays/objects) are not yet supported and are rejected.
Runtime helpers
The following runtime helpers are referenced:
__rt_serialize_begin__rt_serialize_mixed__rt_serialize_value
Signature summary
function serialize(mixed $value): string
What the type checker enforces
- Arity: takes exactly 1 argument.
Eval interpreter (magician)
Not callable from eval’d code — the magician interpreter has no entry for this builtin.