From: farajayh at gmail dot com
Operating system: Linux alma-linux/Windows 10
PHP version: 8.0.12
Package: PHP options/info functions
Bug Type: Feature/Change Request
Bug description:Unexpected behaviour of ignore_repeated_errors php configuration
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 bug report at https://bugs.php.net/bug.php?id=81602&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81602&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81602&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81602&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81602&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81602&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81602&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81602&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81602&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81602&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81602&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81602&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81602&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81602&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81602&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81602&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81602&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81602&r=mysqlcfg