|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-11-09 08:30 UTC] nikic@php.net
[2021-11-09 09:41 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 13:00:01 2025 UTC |
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