|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-28 20:23 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 09:00:01 2025 UTC |
Description: ------------ hello Behaviour of Exception::getTrace() has changed in PHP 5.0.3. There is no mention of this in the PHP ChangeLog, it is a PHP bug. In PHP 5.0.2, Exception::getTrace() returned the same backtrace than debug_backtrace(). In PHP 5.0.3, this is broken and Exception::getTrace() return a different array. Reproduce code: --------------- <?php function A() { throw new exception; } try { A(); } catch(Exception $e) { print_r($e->getTrace()); } ?> <?php function A() { print_r(debug_backtrace()); } A(); ?> Expected result: ---------------- PHP 5.0.2 (for both reproduce codes) : Array ( [0] => Array ( [file] => /anticorps/www/test.php [line] => 9 [function] => A [args] => Array ( ) ) ) Actual result: -------------- PHP 5.0.3 : First code : Array ( [0] => Array ( [file] => /anticorps/www/test.php [line] => 4 [function] => A ) [1] => Array ( [file] => /anticorps/www/test.php [line] => 9 [function] => A [args] => Array ( ) ) ) Second code : Array ( [0] => Array ( [file] => /anticorps/www/test.php [line] => 9 [function] => A [args] => Array ( ) ) )