#25842 [Opn->Bgs]: Error Reporting not catching parse errors
| From: | sniper@php.net | Date: | Sun, 12 Oct 2003 23:57:38 +0000 |
| Subject: | #25842 [Opn->Bgs]: Error Reporting not catching parse errors | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-48867@lists.php.net to get a copy of this message | ||
ID: 25842
Updated by: sniper@php.net
Reported By: corrupted_wise at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: Win XP SP1
PHP Version: 4.3.4RC1
New Comment:
RTFM: http://www.php.net/set_error_handler
"Note: The following error types cannot be handled with a user defined
function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING,
E_COMPILE_ERROR and E_COMPILE_WARNING."
Previous Comments:
------------------------------------------------------------------------
[2003-10-11 23:08:21] corrupted_wise at yahoo dot com
Description:
------------
When attempting to catch an error with a set_error_handler function, it
always misses a parse error. For example, when loading a php file, no
matter if require, include, require_once..etc. is used, the default php
bold errors are displayed when the function is ignored. Notice errors
load fine, tho.
I have not made any changes to php.ini-dist, and no modules.
I'm running this on Apache 2.0.47.
Reproduce code:
---------------
<?php
function error_handler($errno, $errstr, $errfile, $errline, $errctx) {
echo "\nerror_handler:\n\terrno=$errno\n\terrstr=$errstr\n";
echo "\terrfile=$errfile\n\terrline=$errline\n";
die();
}
set_error_handler("error_handler");
error_reporting(E_ALL);
// load file with parse error
include "error.php";
exit;
?>
Expected result:
----------------
error_handler:
errno=4
errstr=Parse error: parse error, unexpected ',', expecting ']' in
error.php on line 65
errfile=error.php
errline=1
Actual result:
--------------
<b>Parse error: parse error, unexpected ',', expecting ']' in error.php
on line 65</b>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25842&edit=1