Skip to content

Commit 2e88e87

Browse files
authored
Merge pull request #86 from nikic/error-handling
Adjust silencing check for PHP 8
2 parents 5c0bf1e + 51e4e04 commit 2e88e87

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

scripts/pearcmd.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -444,19 +444,17 @@ function cmdHelp($command)
444444
*/
445445
function error_handler($errno, $errmsg, $file, $line)
446446
{
447-
if ($errno & E_STRICT
448-
|| $errno & E_DEPRECATED
449-
|| !error_reporting()
447+
if ($errno & E_STRICT) {
448+
return; // E_STRICT
449+
}
450+
if ($errno & E_DEPRECATED) {
451+
return; // E_DEPRECATED
452+
}
453+
if (!(error_reporting() & $errno) &&
454+
isset($GLOBALS['config']) &&
455+
$GLOBALS['config']->get('verbose') < 4
450456
) {
451-
if ($errno & E_STRICT) {
452-
return; // E_STRICT
453-
}
454-
if ($errno & E_DEPRECATED) {
455-
return; // E_DEPRECATED
456-
}
457-
if (!error_reporting() && isset($GLOBALS['config']) && $GLOBALS['config']->get('verbose') < 4) {
458-
return false; // @silenced error, show all if debug is high enough
459-
}
457+
return false; // @silenced error, show all if debug is high enough
460458
}
461459
$errortype = array (
462460
E_DEPRECATED => 'Deprecated Warning',

0 commit comments

Comments
 (0)