← All docs

json_encode() — internals

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

json_encode() — internals

Where it lives

Lowering notes

  • Lowers json_encode(value, flags?, depth?) through the shared JSON encoder runtime.

Runtime helpers

No direct __rt_* helpers captured — the lowering is inlined or routes through another builtin.

Signature summary

function json_encode(mixed $value, int $flags = 0, int $depth = 512): string

What the type checker enforces

  • Arity: takes 1–3 arguments (2 optional).

Eval interpreter (magician)

Cross-references