From:             misu200 at yahoo dot com
Operating system: Fedora Linux kernel 2.6.4
PHP version:      5.0.0RC1
PHP Bug Type:     Unknown/Other Function
Bug description:  debug_backtrace() bug

Description:
------------
I set my own error handle function and then i try to include a
non-existent file (aga.php).The problem is when i make a
var_dump(debug_backtrace()) in my error handle function it shows me wrong
results.

Reproduce code:
---------------
<?php

function ourErrorHandler($errNo, $errStr, $errFile, $errLine)
{

echo "<PRE>";
var_dump(debug_backtrace());
echo "</PRE>";
}


// set the user error handler to be the above 

$oldErrorHandler = set_error_handler("ourErrorHandler",
error_reporting());

require_once("aga.php");

?>

Expected result:
----------------
array(2) {
  [0]=>
  array(3) {
    ["file"]=>
    string(28) "/var/www/html/dir1/file2.php"
    ["line"]=>
    int(15)
    ["function"]=>
    string(15) "ourErrorHandler"
  }
  [1]=>
  array(4) {
    ["file"]=>
    string(28) "/var/www/html/dir1/file2.php"
    ["line"]=>
    int(15)
    ["args"]=>
    array(1) {
     [0]=>
     string(28) "aga.php" < - this should be here
    }
    ["function"]=>
    string(12) "require_once"
  }
}

Actual result:
--------------
array(2) {
  [0]=>
  array(3) {
    ["file"]=>
    string(28) "/var/www/html/dir1/file2.php"
    ["line"]=>
    int(15)
    ["function"]=>
    string(15) "ourErrorHandler"
  }
  [1]=>
  array(4) {
    ["file"]=>
    string(28) "/var/www/html/dir1/file2.php"
    ["line"]=>
    int(15)
    ["args"]=>
    array(1) {
     [0]=>
     string(28) "/var/www/html/dir1/file2.php" <- is wrong
    }
    ["function"]=>
    string(12) "require_once"
  }
}


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

Reply via email to