diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php index cfe73743f..de892f6be 100644 --- a/lib/Cake/Error/ErrorHandler.php +++ b/lib/Cake/Error/ErrorHandler.php @@ -204,7 +204,9 @@ class ErrorHandler { * @return bool true if error was handled */ public static function handleError($code, $description, $file = null, $line = null, $context = null) { - if (error_reporting() === 0) { + //PHP8 migration guide: https://www.php.net/manual/en/migration80.incompatible.php + //See: @ operator + if (!(error_reporting() & $code)) { return false; } list($error, $log) = static::mapErrorCode($code);