Special
NullableType
Section titled “NullableType”class NullableType implements Type{ public function __construct( public readonly Type $innerType ) {}}Represents any type that is nullable. This includes nullable NamedType, but also literal null in unions:
?string,string|nullstring|int|null
MixedType
Section titled “MixedType”class MixedType implements Type {}Represents mixed type.
NeverType
Section titled “NeverType”class NeverType implements Type {}Represents the never type.
VoidType
Section titled “VoidType”class VoidType implements Type {}Represents the void type.
ErrorType
Section titled “ErrorType”class ErrorType implements Type{ public function __construct( public readonly string $type, ) {}}Represents any type that either failed to parse, or isn’t supported by the type system yet. It contains the string that failed to parse for easier debugging.