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

Reply via email to