← All docs

mb_ereg_match() — internals

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

mb_ereg_match() — internals

Where it lives

Lowering notes

  • Uses the runtime_call strategy from the single-source builtin descriptor.
  • Emits the typed EIR target runtime.mb_ereg_match through BuiltinLoweringContext.
  • The backend resolves that typed target through src/codegen/lower_inst/runtime_calls.rs; PHP builtin names do not participate in dispatch.

Semantic descriptor

  • Target strategy: runtime_call
  • Validation: checker_hook
  • Result type source: checked
  • Result ownership: may_alias_arguments
  • Effects: static (16 declared effects)
  • Requirements: static (0 requirements)
  • Callable policy: static_only
  • Target support: macos-aarch64, ios-arm64, ios-sim-arm64, linux-aarch64, linux-x86_64

EIR and runtime boundary

  • Typed EIR target: runtime.mb_ereg_match
  • Backend boundary: src/codegen/lower_inst/runtime_calls.rs resolves the typed target without PHP-name dispatch.
  • Concrete helpers referenced directly by this lowering:
    • __rt_mb_ereg_match

Signature summary

function mb_ereg_match(string $pattern, string $subject, ?string $options = null): bool

What the type checker enforces

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

Eval interpreter (magician)

Cross-references