There is an error about error_reporting()'s return value inside an error handler in the documentation.
"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 of this (bitwise) expression: E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE."
In fact, in PHP 8.0.0+, error_reporting() in an error handler returns $error_reporting & (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE), where $error_reporting is the value of the global error_reporting ini directive set, no matter through ini or error_reporting().