diff --git a/adodb-errorhandler.inc.php b/adodb-errorhandler.inc.php index 0cd3f218b..1d3b9e9e5 100644 --- a/adodb-errorhandler.inc.php +++ b/adodb-errorhandler.inc.php @@ -37,7 +37,14 @@ */ function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) { - if (error_reporting() == 0) return; // obey @ protocol + // Do not throw if errors are suppressed by @ operator + // error_reporting() value for suppressed errors changed in PHP 8.0.0 + $suppressed = version_compare(PHP_VERSION, '8.0.0', '<') + ? 0 + : E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE; + if (error_reporting() == $suppressed) { + return; + } switch($fn) { case 'EXECUTE': $sql = $p1; diff --git a/adodb-errorpear.inc.php b/adodb-errorpear.inc.php index 2bb15947e..7b173da84 100644 --- a/adodb-errorpear.inc.php +++ b/adodb-errorpear.inc.php @@ -52,7 +52,15 @@ function ADODB_Error_PEAR($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false) { global $ADODB_Last_PEAR_Error; - if (error_reporting() == 0) return; // obey @ protocol + // Do not throw if errors are suppressed by @ operator + // error_reporting() value for suppressed errors changed in PHP 8.0.0 + $suppressed = version_compare(PHP_VERSION, '8.0.0', '<') + ? 0 + : E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE; + if (error_reporting() == $suppressed) { + return; + } + switch($fn) { case 'EXECUTE': $sql = $p1;