← All docs
strstr() — internals
Compiler internals for strstr(): lowering path, type checks, and runtime helpers.
strstr() — internals
Where it lives
- Signature:
src/builtins/string/strstr.rs - Lowering:
src/codegen/lower_inst/builtins/strings.rs:824 (lower_strstr) - Function symbol:
lower_strstr()
Lowering notes
- Lowers
strstr(haystack, needle)by searching and returning the matching suffix.
Runtime helpers
No direct __rt_* helpers captured — the lowering is inlined or routes through another builtin.
Signature summary
function strstr(string $haystack, string $needle, bool $before_needle = false): string
What the type checker enforces
- Arity: takes 2–3 arguments (1 optional).
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/string/strstr.rs(eval_builtin!) - Dispatch hooks:
direct,values