Since: 8.0

class ReflectionUnionType extends ReflectionType (View source)

Methods

bool
allowsNull()

Checks if null is allowed

bool
isBuiltin()

Checks if it is a built-in type

string
__toString()

To string

array
getTypes()

Get list of types of union type

Details

bool allowsNull()

Since: 7.0

Checks if null is allowed

Return Value

bool

Returns {\true} if {\null} is allowed, otherwise {\false}

bool isBuiltin()

Since: 7.0

Checks if it is a built-in type

Return Value

bool

Returns {\true} if it's a built-in type, otherwise {\false}

string __toString()

Since: 7.0

To string

Return Value

string

Returns string representation of the object that implements this interface (and/or "__toString" magic method).

See also

ReflectionNamedType::getName

array getTypes()

Get list of types of union type

Return Value

array