|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75924 No doc: behavior of @ini_get('error_reporting') was changed from 5.6 to 7.0
Submitted: 2018-02-06 12:56 UTC Modified: 2018-02-06 13:36 UTC
From: mikko dot rantalainen at peda dot net Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 7.2.2 OS: Linux/Ubuntu
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-02-06 12:56 UTC] mikko dot rantalainen at peda dot net
From manual page:

The ini_get('error_reporting') was historically the only way to get same results as current implementation of error_reporting(). However, the behavior
of ini_get('error_reporting') was changed between PHP 5.6 and 7.0 but this has not been documented anywhere.

See for demo.

Note that this also affect all custom error handlers that inspect value of ini_get('error_reporting') and not just @ini_get() syntax.

I assume that PHP 7.x ignores at-sign by design (the function name suggests that this is the value set in the ini file) but this change is missing official documentation.

I'd prefer this to be documented in both and

Test script:
# different results for PHP 5.x and 7.x:
ini_set('error_reporting', 1);
$a = array();
$a['ini_get'] = ini_get('error_reporting');
$a['error_reporting'] = error_reporting();
$a['@ini_get'] = @ini_get('error_reporting');
$a['@error_reporting'] = @error_reporting();

Expected result:
The output should be stable for all versions.

Actual result:
Behavior is stable for 5.x and all versions of hhvm. However, PHP 7.x will ignore the at-sign (@) in front of ini_get(). I believe that PHP 4.x used to work identical to 5.x here but I do not have any environment to test that.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-06 13:36 UTC]
-Summary: No doc: behavior of ini_get('error_reporting') was changed from 5.6 to 7.0 +Summary: No doc: behavior of @ini_get('error_reporting') was changed from 5.6 to 7.0 -Package: Documentation problem +Package: Scripting Engine problem
 [2018-02-06 13:36 UTC]
The @ is not being ignored. Rather, (as I remember it) when @ suppresses error reporting it no longer affects the INI setting. ini_get() will properly report what the setting is, not the temporary value established during the expression evaluation. What I don't know/remember is whether this is tied to a bug report (couldn't find one) or one of 7.0's many other changes (AST?).

Since the behavior is from the @ I think noting the change is best suited for that doc page.
 [2023-06-19 10:42 UTC] bloogersitelist at gmail dot com
Floor Decorate News are sharing latest news about about floor, decorate, design,estate etc. More info to visit: (
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 25 11:01:33 2024 UTC