in_array()
function in_array(mixed $needle, array $haystack, bool $strict = false): bool
Checks if a value exists in an array.
Parameters:
$needle(mixed)$haystack(array)$strict(bool), defaultfalse, optional
Returns: bool
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/array/in_array.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how in_array is implemented in the compiler, see the internals page.