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:5
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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jtojnar at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

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 Dec 22 03:01:28 2024 UTC