From 506210b757c0c9a931faa670a96be75ddefb8a58 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Thu, 2 May 2024 12:12:46 +0300 Subject: [PATCH] Fixing suppressed errors handling for PHP8 --- error.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/error.inc.php b/error.inc.php index 3577611..1ca0814 100644 --- a/error.inc.php +++ b/error.inc.php @@ -5,8 +5,10 @@ function _gamectl_error_handler($errno, $errstr, $errfile, $errline) if($errno == E_STRICT) return; - // @ sign temporary disabled error reporting - if(error_reporting() == 0) + $PHP_8_SUPPRESSED = E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE; + $err_rep = error_reporting(); + // check if error was suppressed by @ + if($err_rep === 0 || $err_rep === $PHP_8_SUPPRESSED) return; $err = "Error happened: $errno, $errstr, $errfile, $errline\n";