|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80700 @error_reporting($foo) does not change error_reporting
Submitted: 2021-02-03 09:12 UTC Modified: -
Avg. Score:4.6 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (50.0%)
From: jtojnar at gmail dot com Assigned:
Status: Open Package: *General Issues
PHP Version: 8.0.1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jtojnar at gmail dot com
New email:
PHP Version: OS:


 [2021-02-03 09:12 UTC] jtojnar at gmail dot com
As per #80548, it is expected that @error_reporting() returns junk but I would still expect it to change the error_reporting value when passed an argument. It does not do that on PHP 8.

Not sure why was error_reporting silenced in the codebase in the first place, maybe it could trigger some undocumented errors in the past. Or maybe the author was just being overly cautious.

Possibly related #75924

Test script:
// demo:

var_dump(error_reporting()); // does not returns E_ERROR on PHP 8.0

Expected result:
The last line should return E_ERROR as it does on PHP < 8.

Actual result:
It returns E_ALL.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-27 21:48 UTC] antonino dot spampinato86 at gmail dot com
relative to #80548
not a bug #80750
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 09:01:32 2024 UTC