From:             DavidSmith at byu dot net
Operating system: Linux
PHP version:      4.3.5
PHP Bug Type:     Scripting Engine problem
Bug description:  include causes script termination on syntax error

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 bug report at http://bugs.php.net/?id=28078&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28078&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28078&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28078&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28078&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28078&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28078&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28078&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28078&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28078&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28078&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28078&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28078&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28078&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28078&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28078&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28078&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28078&r=float

Reply via email to