|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-01 09:15 UTC] john_mash02 at yahoo dot co dot uk
[2005-01-19 03:16 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 17:00:01 2025 UTC |
Description: ------------ It looks like when we use custom error handler, the output from debug_backtrace() differs in important parts than with default error handler used. Other environment: Apache 1.3 Zend Engine 1.3.0 Reproduce code: --------------- <?php function __error_handler($errno, $errstr, $errfile, $errline,$errcontext) { #{{{ echo '<pre>'; var_dump(debug_backtrace()); die(); } #}}} set_error_handler('__error_handler'); function wantString($string) { return(wantNumber(12345)); } function wantNumber($number) { trigger_error('ok thats error message'); } wantString('this is a string'); ?> Expected result: ---------------- Expecting output from debug_backtrace with function arguments associated to proper function. i.e. (edited few lines from "Actual result") [2]=> array(4) { ["file"]=> string(51) "d:\_www-nechranene\vyvoj\main-include\test-dbtr.php" ["line"]=> int(10) ["function"]=> string(10) "wantnumber" ["args"]=> &array(1) { ["number"]=> int(12345) } Actual result: -------------- Function wantNumber was called with number argument, but here we have it with string? array(4) { [0]=> array(2) { ["function"]=> string(15) "__error_handler" ["args"]=> array(5) { [0]=> ∫(1024) [1]=> &string(22) "ok thats error message" [2]=> &string(51) "d:\_www-nechranene\vyvoj\main-include\test-dbtr.php" [3]=> ∫(14) [4]=> &array(1) { ["number"]=> int(12345) } } } [1]=> array(3) { ["file"]=> string(51) "d:\_www-nechranene\vyvoj\main-include\test-dbtr.php" ["line"]=> int(14) ["function"]=> string(13) "trigger_error" } [2]=> array(4) { ["file"]=> string(51) "d:\_www-nechranene\vyvoj\main-include\test-dbtr.php" ["line"]=> int(10) ["function"]=> string(10) "wantnumber" ["args"]=> array(1) { [0]=> &string(22) "ok thats error message" } } [3]=> array(3) { ["file"]=> string(51) "d:\_www-nechranene\vyvoj\main-include\test-dbtr.php" ["line"]=> int(17) ["function"]=> string(10) "wantstring" } }