Req #74475 [Opn->Dup]: require() REALLY should throw exceptions
| From: | nikic@php.net | Date: | Fri, 05 Jun 2020 07:47:23 +0000 |
| Subject: | Req #74475 [Opn->Dup]: require() REALLY should throw exceptions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227327@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74475&edit=1
ID: 74475
Updated by: nikic@php.net
Reported by: spam2 at rhsoft dot net
Summary: require() REALLY should throw exceptions
-Status: Open
+Status: Duplicate
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: Irrelevant
PHP Version: 7.1.5RC1
Block user comment: N
Private report: N
New Comment:
Duplicate of bug #72089, fixed in PHP 8.
Previous Comments:
------------------------------------------------------------------------
[2017-04-19 18:54:14] spam2 at rhsoft dot net
Description:
------------
this is REALLY a problem when you have a handler for 3rd party modules where you can't say
"uhm please use include()" when your whole application get stopped instead procude a
pretty page with navigation and a clear error message
the same problem with:
https://bugs.php.net/bug.php?id=51407
https://bugs.php.net/bug.php?id=73451
PLEASE - fix all that "Fatal error" stuff and make it catchable
Warning: require(non-existing): failed to open stream: No such file or directory in
/mnt/data/downloads/test.php on line 4
Fatal error: require(): Failed opening required 'non-existing'
(include_path='.:/Volumes/dune/www-servers/phpincludes:/usr/share/pear:/usr/share/php') in
/mnt/data/downloads/test.php on line 4
Test script:
---------------
<?php
try
{
require('non-existing');
}
catch(Throwable $exception)
{
echo $exception;
}
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74475&edit=1