php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27136 Including a missing file leads to parse error
Submitted: 2004-02-03 19:10 UTC Modified: 2004-02-04 20:06 UTC
From: rickard at punbb dot org Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2004-02-03 (dev) OS: Linux 2.4
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: rickard at punbb dot org
New email:
PHP Version: OS:

 

 [2004-02-03 19:10 UTC] rickard at punbb dot org
Description:
------------
When including a non-existant file with include(), PHP halts execution claiming there is a parse error in the included file.

"Fatal error: Parse error inside included file. in /path/to/file.php on line 3"

This makes it impossible to "attempt" inclusion of a file without halting the script if it can't be found. The behaviour only applies to include() and not include_once(), require() or require_once().

Maybe this is related to #26814.

Reproduce code:
---------------
<?php

@include 'missing-file.php';
echo 'Test';

?>

Expected result:
----------------
The script should output "Test".

Actual result:
--------------
There is no output (a blank page).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-04 20:06 UTC] sniper@php.net
Already fixed..

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Dec 02 02:00:01 2025 UTC