|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28078 include causes script termination on syntax error
Submitted: 2004-04-20 15:53 UTC Modified: 2004-04-20 18:57 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: DavidSmith at byu dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.3.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: DavidSmith at byu dot net
New email:
PHP Version: OS:


 [2004-04-20 15:53 UTC] DavidSmith at byu dot net
Under previous versions of PHP, calling include() on a file containing syntax errors did not cause script termination. This is in accordance with the documentation on include(). However, in 4.3.5, syntax errors in included files appear to cause script termination. Tested with 4.1.x, 4.2.x, and 4.3.1.

Reproduce code:
Two files are required to reproduce this bug:

1. test.php:
echo "including...<br>\n";
include 'test-error.php';
echo "done.<br>\n";

2. test-error.php (intentionally contains a syntax error):

Expected result:
It is expected that a syntax error will not cause script termination. Thus, the expected output is this:


Parse error: parse error, unexpected '*' in /var/www/test-error.php on line 3

Actual result:

Parse error: parse error, unexpected '*' in /var/www/test-error.php on line 3

Notice that "done." is not printed, since script execution terminated on the include() line.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-20 18:57 UTC]
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 27 02:03:36 2021 UTC