← All docs

unserialize() — internals

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

unserialize() — internals

Where it lives

Lowering notes

  • Lowers unserialize($data, $options?) into the shared unserialize runtime helper.
  • The source string is parsed by __rt_unserialize_mixed; a null result pointer
  • (parse error or unsupported wire form) is boxed as PHP false. The optional
  • $options argument is accepted but currently ignored.

Runtime helpers

The following runtime helpers are referenced:

  • __rt_mixed_cast_string
  • __rt_unserialize_begin
  • __rt_unserialize_mixed

Signature summary

function unserialize(string $data, mixed $options = []): mixed

What the type checker enforces

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

Eval interpreter (magician)

Not callable from eval’d code — the magician interpreter has no entry for this builtin.

Cross-references