← All docs
strtotime() — internals
Compiler internals for strtotime(): lowering path, type checks, and runtime helpers.
strtotime() — internals
Where it lives
- Signature:
src/builtins/system/strtotime.rs - Lowering:
src/codegen/lower_inst/builtins/system.rs:487 (lower_strtotime) - Function symbol:
lower_strtotime()
Lowering notes
- Lowers
strtotime(datetime[, baseTimestamp])through the shared parser runtime helper. - Returns PHP’s
int|false: the__rt_strtotimei64::MINparse-failure sentinel is boxed as Mixedfalse, and every other value (including a real-1pre-epoch timestamp) is boxed as- a
Mixedinteger, so=== false,=== -1, andechoall observe the distinct results. - Supports PHP’s optional
$baseTimestamp. (The__elephc_strtotime_rawalias keeps the plain -1integer shape for the syntheticDateTimeinternals.)
Runtime helpers
The following runtime helpers are referenced:
__rt_mixed_from_value__rt_strtotime
Signature summary
function strtotime(string $datetime, int $baseTimestamp = null): mixed
What the type checker enforces
- Arity: takes 1–2 arguments (1 optional).
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/time/strtotime.rs(eval_builtin!) - Dispatch hooks:
direct,values