Bug #80700 [NEW]: @error_reporting($foo) does not change error_reporting
| From: | jtojnar at gmail dot com | Date: | Wed, 03 Feb 2021 09:12:46 +0000 |
| Subject: | Bug #80700 [NEW]: @error_reporting($foo) does not change error_reporting | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-231897@lists.php.net to get a copy of this message | ||
From: jtojnar at gmail dot com
Operating system: Linux
PHP version: 8.0.1
Package: *General Issues
Bug Type: Bug
Bug description:@error_reporting($foo) does not change error_reporting
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 bug report at https://bugs.php.net/bug.php?id=80700&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80700&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80700&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80700&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80700&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80700&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80700&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80700&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80700&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80700&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80700&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80700&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80700&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80700&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80700&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80700&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80700&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80700&r=mysqlcfg