← All docs
header() — internals
Compiler internals for header(): lowering path, type checks, and runtime helpers.
header() — internals
Where it lives
- Signature:
src/builtins/system/header.rs - Lowering:
src/codegen/lower_inst/builtins/system.rs:289 (lower_header) - Function symbol:
lower_header()
Lowering notes
- Lowers
header($line[, $replace[, $code]])to__rt_header, materializing the - four C-ABI integer arguments: arg0=line ptr, arg1=line len, arg2=
$replace - (default true), arg3=
$response_code(default 0).$replace/$codeare staged - to scratch first (their evaluation may call helpers that clobber the string
- registers), then the line string is loaded and the staged ints reloaded into
- arg2/arg3. All PHP
header()behavior lives in the bridge (elephc_web_header).
Runtime helpers
The following runtime helpers are referenced:
__rt_header
Signature summary
function header(string $header, bool $replace = true, int $response_code = 0): void
What the type checker enforces
- Arity: takes 1–3 arguments (2 optional).
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/time/header.rs(eval_builtin!) - Dispatch hooks:
direct,values