|  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.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (33.3%)
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 04:01:24 2021 UTC