# Changed Error Messages

> Section in “New and Extended Functionality › Type System” 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/new-and-extended-functionality/type-system/changed-error-messages/>

Some error messages had to be adjusted to reflect the matching PHP type and to avoid confusion.

Calling the internal function `mt_rand()`, for instance with a parameter of the wrong type in PHP 5 lead to the following output:

    php -r 'mt_rand("abc");'
    PHP Warning:
    mt_rand() expects parameter 1 to be long, string given

With PHP 7 the same error now shows the correct type information:

    php -r 'mt_rand("abc");'
    PHP Warning:
    mt_rand() expects parameter 1 to be integer, string given

---

Previous: [Typed Values from ini Files](https://php7explained.com/new-and-extended-functionality/type-system/typed-values-from-ini-files/index.html.md) | Next: [Language Features](https://php7explained.com/new-and-extended-functionality/language-features/index.html.md)
