Req #81602 [Opn->Dup]: Unexpected behaviour of ignore_repeated_errors php configuration

From: Date: Tue, 09 Nov 2021 09:41:19 +0000
Subject: Req #81602 [Opn->Dup]: Unexpected behaviour of ignore_repeated_errors php configuration
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237641@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81602&edit=1 ID: 81602 Updated by: nikic@php.net Reported by: farajayh at gmail dot com Summary: Unexpected behaviour of ignore_repeated_errors php configuration -Status: Open +Status: Duplicate Type: Feature/Change Request Package: PHP options/info functions Operating System: Linux alma-linux/Windows 10 PHP Version: 8.0.12 Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2021-11-09 08:30:33] nikic@php.net Duplicate of #81591, which will be fixed in the next PHP 8.0 release. ------------------------------------------------------------------------ [2021-11-09 08:25:52] farajayh at gmail dot com Description: ------------ When "display_errors" is set to "On", only the first error in a script is reported, even if there are multiple errors of different types, in different lines across the script, and error_reporting is set to E_ALL. However, if ignore_repeated_errors is set to "Off", all errors are displayed as they should. The ignore_repeated_errors flag prevents same error of same type, in the same line from being displayed more than once, according to the documentation. But in this case, it prevents all errors, asides the first error, from being displayed. PS: When ignore_repeated_errors is set to "On", only the first error is logged in my log file, even if the errors are of different types and occurs in different lines across the script. Test script: --------------- <?php ini_set("display_errors", "On"); error_reporting(E_ALL); ini_set("ignore_repeated_errors", "On"); echo $undefined_variable; //This should display a notice report include("non-existing-file"); //This should display a warning report //This should display a fatal error before script termination require_once("non-existing-file"); Expected result: ---------------- Warning: Undefined variable $undefined_variable in /var/www/html/mysite/test.php on line 5 Warning: include(non-existing-file): Failed to open stream: No such file or directory in /var/www/html/mysite/test.php on line 7 Warning: include(): Failed opening 'non-existing-file' for inclusion (include_path='.:/usr/share/pear:/usr/share/php:/usr/share/pear:/usr/share/php') in /var/www/html/mysite/test.php on line 7 Warning: require_once(non-existing-file): Failed to open stream: No such file or directory in /var/www/html/mysite/test.php on line 10 Fatal error: Uncaught Error: Failed opening required 'non-existing-file' (include_path='.:/usr/share/pear:/usr/share/php:/usr/share/pear:/usr/share/php') in /var/www/html/mysite/test.php:10 Stack trace: #0 {main} thrown in /var/www/html/mysite/test.php on line 10 Actual result: -------------- Warning: Undefined variable $undefined_variable in /var/www/html/mysite/test.php on line 5 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81602&edit=1

« previous php.bugs (#237641) next »