← All docs

strtotime() — internals

Compiler internals for strtotime(): lowering path, type checks, and runtime helpers.

strtotime() — internals

Where it lives

Lowering notes

  • Lowers strtotime(datetime[, baseTimestamp]) through the shared parser runtime helper.
  • Returns PHP’s int|false: the __rt_strtotime i64::MIN parse-failure sentinel is boxed as
  • Mixed false, and every other value (including a real -1 pre-epoch timestamp) is boxed as
  • a Mixed integer, so === false, === -1, and echo all observe the distinct results.
  • Supports PHP’s optional $baseTimestamp. (The __elephc_strtotime_raw alias keeps the plain
  • -1 integer shape for the synthetic DateTime internals.)

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)

Cross-references