← All docs

settype()

Sets the type of a variable.

settype()

function settype(mixed $var, string $type): bool

Sets the type of a variable.

Parameters:

  • $var (mixed), passed by reference
  • $type (string)

Returns: bool

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how settype is implemented in the compiler, see the internals page.