|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-08-11 14:49 UTC] cmb@php.net
-Status: Open
+Status: Wont fix
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: cmb
[2021-08-11 14:49 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 14:00:01 2025 UTC |
Description: ------------ The debug_backtrace() provides very useful information when debugging. Could it be possible to extend the args element within the trace so that rather than just the index of the argument being shown, show the actual text that was used? Either as a key to the args array or as a new array which could be array_combined in userland. Whilst the file and line values help in getting the code that made the call, if the call is over many lines ... fn( var1, // comments var2, // comments var3 // comments ); sort of thing, then the line number is the end of the call. The output below shows line 15 which is ... ); Not a lot of use and using regex with all the potential of unmatched ) etc. is a pain. Thanks for looking if you do. Richard Quadling. Reproduce code: --------------- <?php function fn() { print_r(debug_backtrace()); } $a_Sites = array ( 'Web' => 'www.php.net', 'Docs' => 'docs.php.net', 'Wiki' => 'wiki.php.net', ); fn ( $a_Sites ); Expected result: ---------------- Array ( [0] => Array ( [file] => C:\dbt.php [line] => 13 [function] => fn [args] => Array ( [$a_Sites] => Array ( [Web] => www.php.net [Docs] => docs.php.net [Wiki] => wiki.php.net ) ) ) ) or Array ( [0] => Array ( [file] => C:\dbt.php [line] => 15 [function] => fn [args] => Array ( [0] => Array ( [Web] => www.php.net [Docs] => docs.php.net [Wiki] => wiki.php.net ) ) [params] => Array ( [0] => $a_Sites ) ) ) Actual result: -------------- Array ( [0] => Array ( [file] => C:\dbt.php [line] => 15 [function] => fn [args] => Array ( [0] => Array ( [Web] => www.php.net [Docs] => docs.php.net [Wiki] => wiki.php.net ) ) ) )