On Wed, Dec 2, 2020 at 2:56 PM Benjamin Morel <benjamin.mo...@gmail.com>
wrote:

> Hi internals,
>
> Since PHP 8.0, `error_reporting()` started returning a non-zero value when
> the @ silence operator is used.
>
> Demo: https://3v4l.org/CovYv
>
> Is this intentional? This breaks scripts that converted all errors to
> exceptions, except those where the silence operator was used:
>
>     set_error_handler(function ($severity, $message, $file, $line) {
>         if (error_reporting() === 0) {
>             return;
>         }
>
>         throw new ErrorException($message, 0, $severity, $file, $line);
>     });
>
> Thank you,
> Benjamin
>

Search for "error_reporting()" on
https://www.php.net/manual/en/migration80.incompatible.php, it discusses
exactly this code ;)

Regards,
Nikita

Reply via email to