File tree Expand file tree Collapse file tree 2 files changed +42
-10
lines changed
Expand file tree Collapse file tree 2 files changed +42
-10
lines changed Original file line number Diff line number Diff line change @@ -760,16 +760,14 @@ void xdebug_append_printable_stack(xdebug_str *str, int html)
760760 xdebug_str_add_literal (str , "..." );
761761 }
762762
763- if (fse -> var [j ].name ) {
764- if (html ) {
765- xdebug_str_add_literal (str , "<span>$" );
766- xdebug_str_add_zstr (str , fse -> var [j ].name );
767- xdebug_str_add_literal (str , " = </span>" );
768- } else {
769- xdebug_str_add_literal (str , "$" );
770- xdebug_str_add_zstr (str , fse -> var [j ].name );
771- xdebug_str_add_literal (str , " = " );
772- }
763+ if (fse -> user_defined == XDEBUG_BUILT_IN && (fse -> op_array -> fn_flags & ZEND_ACC_USER_ARG_INFO ) && fse -> op_array -> arg_info [j ].name ) {
764+ xdebug_str_add_const (str , html ? "<span>$" : "$" );
765+ xdebug_str_add_zstr (str , fse -> op_array -> arg_info [j ].name );
766+ xdebug_str_add_const (str , html ? " = </span>" : " = " );
767+ } else if (fse -> var [j ].name ) {
768+ xdebug_str_add_const (str , html ? "<span>$" : "$" );
769+ xdebug_str_add_zstr (str , fse -> var [j ].name );
770+ xdebug_str_add_const (str , html ? " = </span>" : " = " );
773771 }
774772
775773 if (!variadic_opened && fse -> var [j ].is_variadic && Z_ISUNDEF (fse -> var [j ].data )) {
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Test for bug #2354: The __invoke frame in call stacks don't have the argument name in the trace (< PHP 8.2)
3+ --SKIPIF--
4+ <?php
5+ require __DIR__ . '/../utils.inc ' ;
6+ check_reqs ('PHP < 8.1 ' );
7+ ?>
8+ --INI--
9+ xdebug.mode=develop
10+ --FILE--
11+ <?php
12+ class RedisProxy {
13+ function __construct (public Closure $ c )
14+ {
15+ }
16+
17+ function __call ($ method , $ args )
18+ {
19+ $ this ->c ->__invoke ($ args );
20+ }
21+ }
22+
23+ $ c = function (array $ args )
24+ {
25+ throw new Exception ();
26+ };
27+
28+ $ rp = new RedisProxy ($ c );
29+ $ rp ->isConnected ();
30+ ?>
31+ --EXPECTF--
32+ %A
33+ %w%f %w%d %d. Closure->__invoke($args = []) %sbug02354.php:9
34+ %A
You can’t perform that action at this time.
0 commit comments