php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #33637 include fails on parse error
Submitted: 2005-07-10 23:39 UTC Modified: 2005-07-14 11:21 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: michal at cihar dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.10 OS: Linux
Private report: No CVE-ID: None
 [2005-07-10 23:39 UTC] michal at cihar dot com
Description:
------------
While including file which has a parse error, php stops further processing. As I understand documentation, this should happen only for required files. This is also way it worked in previous php versions.

We use such code in phpMyAdmin for including config file, what allows us to display friendly message when there is some error, however in latest PHP version user gets just empty page.

Reproduce code:
---------------
file1.php:
<?php 
error_reporting(0);
include('./file2.php');
echo 'Test';
?>

file2.php:
<?php
if (
?>

Expected result:
----------------
Test

Actual result:
--------------
empty

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-10 23:49 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 [2005-07-11 00:06 UTC] michal at cihar dot com
I've read the documentation! There is:

"Be warned that parse error in required file doesn't cause processing halting in PHP versions prior to PHP 4.3.5."

It's about required and not about included files. Please either make the documentation clear that the same applies to included file or make interpreter not to fail on this.
 [2005-07-11 00:09 UTC] michal at cihar dot com
Sorry, the quotation was too short, it should have been:

"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."
 [2005-07-11 11:03 UTC] tony2001@php.net
Parse error halts processing in any case, because it's parse error.
Reclassified.
 [2005-07-11 11:19 UTC] michal at cihar dot com
Well it didn't happen before :-)
 [2005-07-11 12:00 UTC] tony2001@php.net
The note you're referring to tells about exactly this change: the behaviour changed in 4.3.5 both for include() and require().

 [2005-07-14 11:21 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"Be warned that parse error in included file doesn't cause processing halting in PHP versions prior to PHP 4.3.5."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 16:01:34 2025 UTC