From: corrupted_wise at yahoo dot com
Operating system: Win XP SP1
PHP version: 4.3.4RC1
PHP Bug Type: Output Control
Bug description: Error Reporting not catching parse errors

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=$errst r\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 bug report at [url]http://bugs.php.net/?id=25842&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25842&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25842&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25842&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25842&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25842&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25842&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25842&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25842&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25842&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25842&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25842&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25842&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25842&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25842&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25842&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=25842&r=float[/url]