From: Jared dot Williams1 at ntlworld dot com
Operating system: Win2000
PHP version: 5.1.3RC2
PHP Bug Type: Scripting Engine problem
Bug description: ErrorException::getTrace() includes the function name of the
error_handler
Description:
------------
The call stack trace includes the name of the function used to map PHP
errors to exceptions. And as getTrace() is marked as final, cannot
override to exclude this.
Reproduce code:
---------------
<?php
function errorToExceptionHandler($severity, $message, $file, $line)
{
if (error_reporting() & $severity)
throw new ErrorException($message, 0, $severity, $file, $line);
}
error_reporting(E_ALL & ~(E_NOTICE|E_USER_NOTICE));
set_error_handler('errorToExceptionHandler');
try
{
$a = 1 / 0;
}
catch (ErrorException $e)
{
var_dump($e->getTrace());
}
catch (ErrorException $e)
{
var_dump($e->getTrace());
}
Expected result:
----------------
array
0 =>
array
'file' => 'C:\Inetpub\Framework\www\bug.php' (length=32)
'line' => 14
Actual result:
--------------
array
0 =>
array
'file' => 'C:\Inetpub\Framework\www\bug.php' (length=32)
'line' => 14
'function' => 'errorToExceptionHandler' (length=23)
--
Edit bug report at http://bugs.php.net/?id=37224&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=37224&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=37224&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=37224&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37224&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=37224&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37224&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37224&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37224&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37224&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37224&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=37224&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=37224&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37224&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37224&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37224&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37224&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37224&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37224&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37224&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37224&r=mysqlcfg