php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74475 require() REALLY should throw exceptions
Submitted: 2017-04-19 18:54 UTC Modified: 2020-06-05 07:47 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: spam2 at rhsoft dot net Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: 7.1.5RC1 OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: spam2 at rhsoft dot net
New email:
PHP Version: OS:

 

 [2017-04-19 18:54 UTC] 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;
 }
?>



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-12 00:50 UTC] ajf@php.net
-Type: Bug +Type: Feature/Change Request
 [2020-06-05 07:47 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2020-06-05 07:47 UTC] nikic@php.net
Duplicate of bug #72089, fixed in PHP 8.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 04:01:26 2024 UTC