#31736 [Opn->Csd]: E_PARSE on include() and include_once() stops execution
| From: | vrana@php.net | Date: | Tue, 05 Apr 2005 12:48:38 +0000 |
| Subject: | #31736 [Opn->Csd]: E_PARSE on include() and include_once() stops execution | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76382@lists.php.net to get a copy of this message | ||
ID: 31736
Updated by: vrana@php.net
Reported By: jakent at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 5.0.3
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
include:
"Be warned that parse error in required file doesn't cause processing
halting in PHP versions prior to PHP 4.3.5. Since this version, it
does."
Previous Comments:
------------------------------------------------------------------------
[2005-01-28 08:26:17] jakent at gmail dot com
Description:
------------
It appears that bug #26814 caused a minor change in how include,
include_once, require, and require_once function.
In spirit of how include works versus require, I would like to see
execution continue on include and include_once E_PARSE errors.
It makes sense for require and require_once to stop script execution,
since failure causes a fatal error, while include and include_once only
issue a warning.
If nothing happens with this, the documentation needs to be changed.
"Be warned that parse error in required file doesn't cause processing
halting." is still present.
It would help a lot if include reflects the documented behavior once
again.
Jeff Kent
Reproduce code:
---------------
(file 1) test.php
<?php
@include "no_exist.php";
echo "Test1\n";
@include "e_parse.php";
echo "Test2\n";
?>
(file 2) e_parse.php
<?php
echo "Parse error\n
?>
Expected result:
----------------
Test1
Test2
Actual result:
--------------
Test1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31736&edit=1