← All docs

preg_replace() — internals

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

preg_replace() — internals

Where it lives

Lowering notes

  • Lowers preg_replace(pattern, replacement, subject) through the regex replacement helper.

Runtime helpers

The following runtime helpers are referenced:

  • __rt_preg_replace

Signature summary

function preg_replace(string $pattern, string $replacement, string $subject): string

What the type checker enforces

  • Arity: takes exactly 3 arguments.

Eval interpreter (magician)

Cross-references