Bug #79753 [NEW]: Fatal error can not be caught - not with catch nor error handler
| From: | michael dot vorisek at email dot cz | Date: | Sun, 28 Jun 2020 12:39:27 +0000 |
| Subject: | Bug #79753 [NEW]: Fatal error can not be caught - not with catch nor error handler | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-227707@lists.php.net to get a copy of this message | ||
From: michael dot vorisek at email dot cz
Operating system: any
PHP version: Irrelevant
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Fatal error can not be caught - not with catch nor error handler
Description:
------------
see test code, there should be a possibility to catch these/all errors
Test script:
---------------
<?php
class A {
public function x(): void {}
}
set_error_handler(function() { echo 'handled'; });
try {
if (time() > 0) { // wrap in if to make sure an error is not throw
at compile time
class B extends A {
public function x() {}
}
}
} catch (\Throwable $e) {
echo 'catched';
}
Expected result:
----------------
"handled" or "catched"
Actual result:
--------------
fatal error message, no possibility to catch the error
--
Edit bug report at https://bugs.php.net/bug.php?id=79753&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79753&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79753&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79753&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79753&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79753&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79753&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79753&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79753&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79753&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79753&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79753&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79753&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79753&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79753&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79753&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79753&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79753&r=mysqlcfg