php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47486 No message displayed for parse errors in included files
Submitted: 2009-02-24 02:35 UTC Modified: 2009-02-24 23:59 UTC
From: a at a dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.*, 6CVS (2009-02-24) OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: a at a dot com
New email:
PHP Version: OS:

 

 [2009-02-24 02:35 UTC] a at a dot com
Description:
------------
(I'm using IIS, ISAPI)

When there is a parse error in an included file, NO error is displayed
even if display_errors and error_reporting are set correctly.

Reproduce code:
---------------
--main.php--
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL & E_NOTICE);
include("inc.php");
?>
------------

--inc.php--
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL & E_NOTICE);
$testvar = ;
?>
-----------

Expected result:
----------------
Parse error: parse error in [path here]\inc.php on line 4

Actual result:
--------------
None, there is no output at all, and no error gets logged.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-24 10:42 UTC] jani@php.net
Verified using CLI. Errors are displayed correctly when the error_reporting() call is commented out from the main.php
 [2009-02-24 18:18 UTC] amelek32 at gmail dot com
error_reporting(E_ALL & E_NOTICE);

i believe you mean

error_reporting(E_ALL | E_NOTICE);

your code is equivalent to 

error_reporting(E_NOTICE);

error thrown is fatal so it's ignored in such error reporting.
 [2009-02-24 23:59 UTC] scottmac@php.net
I assume they should have used:

error_reporting(E_ALL & ~E_NOTICE);

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 10:01:30 2025 UTC