Bug #74366 [Opn->Nab]: Throwable not catching include and require
| From: | requinix@php.net | Date: | Mon, 03 Apr 2017 19:00:26 +0000 |
| Subject: | Bug #74366 [Opn->Nab]: Throwable not catching include and require | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208298@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74366&edit=1
ID: 74366
Updated by: requinix@php.net
Reported by: tugrultopuz at gmail dot com
Summary: Throwable not catching include and require
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Debian 8.5
PHP Version: 7.0.17
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
include/require raise warnings and errors, not exceptions. If you can't see the messages then
you need to adjust your error reporting settings.
Previous Comments:
------------------------------------------------------------------------
[2017-04-03 18:53:05] tugrultopuz at gmail dot com
Description:
------------
Throwable not catching the error by include and require statements for non existent files.
Test script:
---------------
try {
include 'non-existent-file.php';
} catch (\Throwable $ex) {
echo 'include error';
}
try {
include_once 'non-existent-file.php';
} catch (\Throwable $ex) {
echo 'include_once error';
}
try {
require 'non-existent-file.php';
} catch (\Throwable $ex) {
echo 'require error';
}
try {
require_once 'non-existent-file.php';
} catch (\Throwable $ex) {
echo 'require once error';
}
Expected result:
----------------
include error
include_once error
require error
require_once error
Actual result:
--------------
no output and write errors to error log
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74366&edit=1