str_starts_with()
function str_starts_with(string $haystack, string $needle): bool
Checks if a string starts with a given substring.
Parameters:
$haystack(string)$needle(string)
Returns: bool
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/string/str_starts_with.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how str_starts_with is implemented in the compiler, see the internals page.