Problem/Motivation
_drupal_error_handler_real()
has this first line:
if ($error_level & error_reporting()) {
Now look at this PHP documentation page for error control. Relevant portion quoted here:
Warning
Prior to PHP 8.0.0, the error_reporting() called inside the custom error handler always returned
0
if the error was suppressed by the@
operator. As of PHP 8.0.0, it returns the valueE_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE
.
So the if
statement above is checking if truthy (aka, not zero). I'm wondering if this is still correct in PHP 8, as the value returned from error_reporting()
when errors are suppressed is different, namely it is the value quoted above, which equals 4437
.