Bug #68164 [NEW]: error_get_last() ignores silence operator
| From: | willem at mollie dot nl | Date: | Mon, 06 Oct 2014 13:04:51 +0000 |
| Subject: | Bug #68164 [NEW]: error_get_last() ignores silence operator | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187882@lists.php.net to get a copy of this message | ||
From: willem at mollie dot nl
Operating system: N/A
PHP version: 5.5.17
Package: Unknown/Other Function
Bug Type: Bug
Bug description:error_get_last() ignores silence operator
Description:
------------
The function error_get_last() ignores the silence operator. Functions
such as set_error_handler() received 0 as the value for the error type
when the silence operator is used on the expression that triggered the
error. However, error_get_last() does not.
This is rather inconsistent and makes it impossible to ignore errors
when using error_get_last() for error handling (e.g. in a registered
shutdown function).
Test script:
---------------
php -r '@1/0; print_r(error_get_last());'
Expected result:
----------------
PHP Warning: Division by zero in Command line code on line 1
Array
(
[type] => 0
[message] => Division by zero
[file] => Command line code
[line] => 1
)
Actual result:
--------------
PHP Warning: Division by zero in Command line code on line 1
Array
(
[type] => 2
[message] => Division by zero
[file] => Command line code
[line] => 1
)
--
Edit bug report at https://bugs.php.net/bug.php?id=68164&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68164&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68164&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68164&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68164&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68164&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68164&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68164&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68164&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68164&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68164&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68164&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68164&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68164&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68164&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68164&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68164&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68164&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68164&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68164&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68164&r=mysqlcfg