php.net |  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: -
Votes:4
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-02-03 09:12 UTC] jtojnar at gmail dot com
Description:
------------
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:
---------------
<?php
// demo: https://3v4l.org/odVHc

var_dump(error_reporting(E_ALL));
var_dump(error_reporting());
var_dump(@error_reporting(E_ERROR));
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 04:01:24 2021 UTC