← All docs

getdate() — internals

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

getdate() — internals

Where it lives

Lowering notes

  • Lowers getdate([$timestamp]) through the shared decomposition runtime helper.
  • Marshals the optional timestamp (the -1 current-time sentinel when omitted; a boxed
  • Mixed/Union argument is unboxed) into the integer result register where __rt_getdate
  • reads it, then boxes the returned associative-array hash pointer into a Mixed cell — the same
  • representation stat/getdate use, so the checker types the result Mixed.

Runtime helpers

The following runtime helpers are referenced:

  • __rt_getdate
  • __rt_mixed_from_value

Signature summary

function getdate(int $timestamp = null): array

What the type checker enforces

  • Arity: takes 0–1 arguments (1 optional).

Eval interpreter (magician)

Cross-references