Req #45736 [Opn->Wfx]: Include parameter name in debug_backtrace

From: Date: Wed, 11 Aug 2021 14:49:31 +0000
Subject: Req #45736 [Opn->Wfx]: Include parameter name in debug_backtrace
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235773@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=45736&edit=1 ID: 45736 Updated by: cmb@php.net Reported by: RQuadling at GMail dot com Summary: Include parameter name in debug_backtrace -Status: Open +Status: Wont fix Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: n/a PHP Version: 5.3.0alpha1 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: The name of the parameter is no longer available after compilation. Of course, that could be changed, but I don't see the particular value (at least nowadays), thus I'm closing as WONTFIX. Previous Comments: ------------------------------------------------------------------------ [2008-08-06 15:52:10] RQuadling at GMail dot com 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 ) ) ) ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=45736&edit=1

« previous php.bugs (#235773) next »