← All docs

header() — internals

Compiler internals for header(): lowering path, type checks, and runtime helpers.

header() — internals

Where it lives

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/$code are 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)

Cross-references