ID:               28054
 Updated by:       [EMAIL PROTECTED]
 Reported By:      misu200 at yahoo dot com
 Status:           Assigned
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5CVS-2005-02-14
 Assigned To:      andi
 New Comment:

The problem here is that error handler call does not provide necessary
information for recovering the arguments. This is because include does
not preserve the argument and backtrace bases on the fact that code
executed after include() is necessarily the included file - which is
not the case if include fails, of course. 


Previous Comments:
------------------------------------------------------------------------

[2004-04-19 20:12:47] [EMAIL PROTECTED]

Assigning to the engine guru, Andi.

------------------------------------------------------------------------

[2004-04-19 16:45:48] olivier dot bichler at laposte dot net

And there is an other problem : why the arguments $errNo, $errStr,
$errFile, $errLine are not present in the result of debug_backtrace()
?
I have the same problem...

------------------------------------------------------------------------

[2004-04-19 09:05:28] misu200 at yahoo dot com

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 this bug report at http://bugs.php.net/?id=28054&edit=1

Reply via email to