Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294493

Does the Drupal error_reporting() check still work?

$
0
0

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 value E_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.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 294493

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>