From 20419bd82bc6edc758c41f9d88c2bf2e5ab621ee Mon Sep 17 00:00:00 2001 From: Kamil Wylegala Date: Wed, 24 Feb 2021 23:08:03 +0100 Subject: [PATCH] PHP8: ErrorHandler fixed accordingly to migration guide. --- lib/Cake/Error/ErrorHandler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);