Req #72089 [NEW]: handle all fatal errors with try catch
| From: | paulobitfranca at gmail dot com | Date: | Sat, 23 Apr 2016 21:28:02 +0000 |
| Subject: | Req #72089 [NEW]: handle all fatal errors with try catch | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-200722@lists.php.net to get a copy of this message | ||
From: paulobitfranca at gmail dot com
Operating system: Linux
PHP version: 7.0.5
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:handle all fatal errors with try catch
Description:
------------
I mind that some fatal errors are not handled by the try/catch yet.
For example, when I use require() and the include file doesn't exist.
Is it possible that in a future version, all the fatal erros can be
handled by try/catch?
Test script:
---------------
<?php
error_reporting(E_ALL);
try
{
require("xxx.php");
}
catch (Throwable $e)
{
echo "An error: file doesn't exist"
}
echo "hi!";
Expected result:
----------------
An error: file doesn't exist
Hi!
Actual result:
--------------
Fatal error: require() [function.require.html: Failed opening required
'xxx.php' (include_path='.:/opt/php7/includes') in
/var/www/html/teste.php on line 8
--
Edit bug report at https://bugs.php.net/bug.php?id=72089&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72089&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72089&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72089&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72089&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72089&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72089&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72089&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72089&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72089&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72089&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72089&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72089&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72089&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72089&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72089&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72089&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72089&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72089&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72089&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72089&r=mysqlcfg