← All docs

function_exists() — internals

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

function_exists() — internals

Where it lives

Lowering notes

  • Lowers function_exists("name") for compile-time string names.
  • Recognizes user functions, externs, catalog builtins, and the date/time procedural aliases
  • that name_resolver desugars (including the injected timezone-introspection prelude
  • functions). The aliases are matched through is_date_procedural_alias rather than the catalog
  • because their call sites are rewritten before codegen, so they never reach the builtin catalog
  • yet must still report as existing to match PHP.

Runtime helpers

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

Signature summary

function function_exists(string $function): bool

What the type checker enforces

  • Arity: takes exactly 1 argument.

Eval interpreter (magician)

Cross-references