#28078 [Opn->Csd]: include causes script termination on syntax error

From: Date: Tue, 20 Apr 2004 16:57:06 +0000
Subject: #28078 [Opn->Csd]: include causes script termination on syntax error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58464@lists.php.net to get a copy of this message
ID: 28078 Updated by: derick@php.net Reported By: DavidSmith at byu dot net -Status: Open +Status: Closed Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.3.5 New Comment: Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php Previous Comments: ------------------------------------------------------------------------ [2004-04-20 15:53:27] DavidSmith at byu dot net Description: ------------ 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: <?php echo "including...<br>\n"; include 'test-error.php'; echo "done.<br>\n"; ?> 2. test-error.php (intentionally contains a syntax error): <?php * ?> Expected result: ---------------- It is expected that a syntax error will not cause script termination. Thus, the expected output is this: including... Parse error: parse error, unexpected '*' in /var/www/test-error.php on line 3 done. Actual result: -------------- including... 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28078&edit=1

« previous php.bugs (#58464) next »