13.3 Tracing Types

$type is a compile-time mechanism that is called similarly to a function with a single argument. The compiler evaluates the argument expression and then outputs the type of that expression.

This is useful to evaluate if an expression has a certain type, mostly when dealing with Type inference, which leaves the definition of the type up to the compiler.

var myValue = "foo";
$type(myValue); // String