Built In Types: Introduction
This section covers the different built-in types available in Hack.
Hack supports union types, like:
- num, where
floatare subtypes of
- arraykey, where
stringare subtypes of
Hack's super type is mixed, which represents any value. All other types are subtypes of
A few things to know when working with
mixed as a type:
- The opposite of
mixedis nothing, a special type at the "bottom" of all other types.
mixedis equivalent to
?nonnull. nonnull is a type that represents any value except
Though not built-in as types, other alternatives exist in Hack Collections.