Bug #80700 [Com]: @error_reporting($foo) does not change error_reporting
| From: | antonino dot spampinato86 at gmail dot com | Date: | Fri, 27 Aug 2021 21:48:17 +0000 |
| Subject: | Bug #80700 [Com]: @error_reporting($foo) does not change error_reporting | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236134@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80700&edit=1
ID: 80700
Comment by: antonino dot spampinato86 at gmail dot com
Reported by: jtojnar at gmail dot com
Summary: @error_reporting($foo) does not change
error_reporting
Status: Open
Type: Bug
Package: *General Issues
Operating System: Linux
PHP Version: 8.0.1
Block user comment: N
Private report: N
New Comment:
relative to #80548
not a bug #80750
Previous Comments:
------------------------------------------------------------------------
[2021-02-14 09:04:30] requinix@php.net
Related To: Bug #80750
------------------------------------------------------------------------
[2021-02-14 09:04:30] requinix@php.net
Related To: Bug #80750
------------------------------------------------------------------------
[2021-02-03 09:12:44] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80700&edit=1