Doc #80548 [Opn->Ver]: Value or error_reporting() within handler with errors suppressed is 4437, not 0

From: Date: Thu, 24 Dec 2020 12:05:25 +0000
Subject: Doc #80548 [Opn->Ver]: Value or error_reporting() within handler with errors suppressed is 4437, not 0
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18314@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80548&edit=1 ID: 80548 Updated by: cmb@php.net Reported by: dregad at mantisbt dot org Summary: Value or error_reporting() within handler with errors suppressed is 4437, not 0 -Status: Open +Status: Verified Type: Documentation Problem Package: Documentation problem PHP Version: 8.0.0 Block user comment: N Private report: N New Comment: This is a deliberate change, and already documented in the migration guide[1] (search for "the @ operator"). It is indeed not yet documented in the manual proper. [1] <https://www.php.net/manual/en/migration80.incompatible.php> Previous Comments: ------------------------------------------------------------------------ [2020-12-24 10:24:54] dregad at mantisbt dot org Description: ------------ According to set_error_handler documentation [1], "current value of error_reporting [...] will be 0 if the statement that caused the error was prepended by the @ error-control operator." This works as documented with PHP 7.4, but not in 8.0.0 where error_reporting = 4437. I'm not sure whether this desired behavior or not, but if it is then documentation is incorrect. [1]: https://www.php.net/manual/en/function.set-error-handler.php Test script: --------------- <?php function error_handler( $p_type, $p_error, $p_file, $p_line ) { echo "error_reporting in handler: ", error_reporting(), PHP_EOL; } set_error_handler( 'error_handler' ); @date_default_timezone_set(''); Expected result: ---------------- error_reporting = 0 Actual result: -------------- error_reporting = 4437 (with PHP 7.4, error_reporting = 0 as expected) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80548&edit=1

« previous php.doc.bugs (#18314) next »