← All docs

is_scalar() — internals

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

is_scalar() — internals

Where it lives

Lowering notes

  • Lowers is_scalar(): true for int/float/string/bool, a non-null tagged scalar, or a boxed
  • Mixed/Union value whose runtime tag is int (0), string (1), float (2), or bool (3). Null,
  • arrays, objects, and resources are not scalars, matching PHP.

Runtime helpers

No direct __rt_* helpers captured — the lowering is inlined or routes through another builtin.

Signature summary

function is_scalar(mixed $value): bool

What the type checker enforces

  • Arity: takes exactly 1 argument.

Eval interpreter (magician)

Cross-references