← All docs

http_response_code() — internals

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

http_response_code() — internals

Where it lives

Lowering notes

  • Lowers http_response_code([$code]) to __rt_http_response_code. The code (or
  • 0 = “read current” when omitted) goes into the first integer argument register;
  • the routine returns the resulting status as an int. PHP semantics (read vs set,
  • return-previous) live in the bridge’s elephc_web_set_status.

Runtime helpers

The following runtime helpers are referenced:

  • __rt_header
  • __rt_http_response_code

Signature summary

function http_response_code(int $response_code = 0): int

What the type checker enforces

  • Arity: takes 0–1 arguments (1 optional).

Eval interpreter (magician)

Cross-references