# `mixed` Type

> Section in “Beyond PHP 7.4” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/beyond-php-7.4/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”.

---

Previous: [Union Types](https://php7explained.com/beyond-php-7.4/union-types/index.html.md) | Next: [Constructor Property Promotion](https://php7explained.com/beyond-php-7.4/constructor-property-promotion/index.html.md)
