intval()
function intval(mixed $value, int $base = 10): int
Returns the integer value of a variable, optionally using a given base.
Parameters:
$value(mixed)$base(int), default10, optional
Returns: int
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/types/intval.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how intval is implemented in the compiler, see the internals page.