MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001571XdebugUsage problems (Wrong Results)public2018-08-14 11:182018-10-19 00:53
Reporterderick 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version2.6.1 
Target Version2.7.0devFixed in Version2.7.0dev 
Summary0001571: File/line information is not shown for closures in namespaces
DescriptionWhen making stack traces and for code coverage, we try to add the file/line numbers to the name of the "closure" so that's a bit more like a useful function name. When a closure is created in a namespace, the check fails, as we do an equivalence check of the name "{closure}", where we should check whether the function name **ends** with "{closure}. This is done in both xdebug_code_coverage.c and xdebug_stack.c
Steps To Reproducederick@singlemalt:~ $ php -dxdebug.overload_var_dump=0 -d display_errors=1 -d display_startup_errors=1 -d error_reporting=E_ALL -d xdebug.auto_trace=1 -d xdebug.trace_format=0 -d xdebug.trace_options=0 -d xdebug.collect_params=1 -d xdebug.collect_return=1 -d xdebug.trace_output_dir=/tmp -d xdebug.trace_output_name=trace /tmp/518-ns.php

derick@singlemalt:~ $ cat /tmp/trace.xt 
TRACE START [2018-08-14 10:17:03]
    0.0002     425552   -> {main}() /tmp/518-ns.php:0
    0.0002     425936     -> call_user_func:{/tmp/518-ns.php:8}(class Closure, long, class Closure) 
/tmp/518-ns.php:8
    0.0002     425936       -> A\{closure}(long, class Closure) /tmp/518-ns.php:8
    0.0002     425936        >=> NULL
    0.0002     425936      >=> NULL
    0.0003      50032
TRACE END   [2018-08-14 10:17:03]


derick@singlemalt:~ $ cat /tmp/518-ns.php 
<?php

namespace A;

$a = function(){

};
call_user_func($a, 1, $a);
TagsNo tags attached.
Operating System
PHP Version7.2.0-7.2.4
Attached Files

- Relationships

-  Notes
(0004699)
derick (administrator)
2018-09-20 08:41

There is a branch already.
(0004706)
derick (administrator)
2018-10-19 00:53

Fixed for Xdebug 2.7.0beta2.

- Issue History
Date Modified Username Field Change
2018-08-14 11:18 derick New Issue
2018-08-14 11:18 derick Status new => assigned
2018-08-14 11:18 derick Assigned To => derick
2018-08-14 21:16 derick Steps to Reproduce Updated View Revisions
2018-09-20 08:41 derick Note Added: 0004699
2018-09-20 08:41 derick Target Version 2.6.2 => 2.7.0dev
2018-10-19 00:43 derick Summary Stack traces don't show file/line for closures in namespaces => File/line information is not shown for closures in namespaces
2018-10-19 00:53 derick Note Added: 0004706
2018-10-19 00:53 derick Status assigned => closed
2018-10-19 00:53 derick Resolution open => fixed
2018-10-19 00:53 derick Fixed in Version => 2.7.0dev


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker