php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #31736 E_PARSE on include() and include_once() stops execution
Submitted: 2005-01-28 08:26 UTC Modified: 2005-04-05 14:48 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jakent at gmail dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5.0.3 OS: Any
Private report: No CVE-ID: None
 [2005-01-28 08:26 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-05 14:48 UTC] vrana@php.net
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."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 21:01:26 2024 UTC