mixed
Type
Just like iterable
is a shorthand for the union type
array|Traversable
, the new mixed
type is a
shorthand for all types except for classes and interfaces as well as
void
:
array|bool|callable|int|float|null|object|resource|string
The mixed
type was introduced to enable developers
to indicate in code that the type of a parameter, return value,
property, etc. cannot be specified more precisely. Without such an
indication, the absence of type information could be interpreted as
“the developers do not care about type safety”.