|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
1 + 31 = ?
Subscribe to this entry?

 [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: Sun Sep 19 08:03:37 2021 UTC