← All docs
str_replace() — internals
Compiler internals for str_replace(): lowering path, type checks, and runtime helpers.
str_replace() — internals
Where it lives
- Signature:
src/builtins/string/str_replace.rs - Lowering:
src/codegen/lower_inst/builtins/strings.rs:842 (lower_string_replace) - Function symbol:
lower_string_replace()
Lowering notes
- Lowers
str_replace()/str_ireplace()with three string operands.
Runtime helpers
No direct __rt_* helpers captured — the lowering is inlined or routes through another builtin.
Signature summary
function str_replace(string $search, string $replace, string $subject, int $count = null): string
What the type checker enforces
- Arity: takes 3–4 arguments (1 optional).
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/string/str_replace.rs(eval_builtin!) - Dispatch hooks:
direct,values