View Issue Details

IDProjectCategoryView StatusLast Update
0000799XdebugUncategorizedpublic2017-05-08 18:48
Reporterastorm Assigned Toderick  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
OSOS XOS Version10.6.8 
Product Version2.2dev 
Fixed in Version2.5.4 
Summary0000799: xDebug Function Traces reports Base Class instead of Object Name
Description

When running a function trace xDebug reports on the base class an object's method is defined in, and not on the type of the object instance. Derick's comments on this Stack Overflow thread indicate this is not normal behavior

http://stackoverflow.com/questions/9727414/xdebug-report-on-objects-during-function-trace#comment12422053_9727414

Steps To Reproduce
  1. Create the following PHP program

    xdebug_start_trace();
    abstract class A
    {
    abstract function foo();

    public function bar()
    {
        echo "A Test","\n";
    }

    }

    class B extends A
    {
    public function foo()
    {
    }
    }

    $test = new B;
    $test->bar();

  2. Execute program by visiting it in a web browser

  3. View Trace File

Expected Output:

TRACE START [2012-03-18 22:32:29]
    0.0023     642888     -> B->bar() /path/to/xdebug.php:21
    0.0027       8512
TRACE END   [2012-03-18 22:32:29]

Actual Output

TRACE START [2012-03-18 22:32:29]
    0.0023     642888     -> A->bar() /path/to/xdebug.php:21
    0.0027       8512
TRACE END   [2012-03-18 22:32:29]

The output discrepancy is B->bar() vs. A->bar(). The object was instantiated with a class "B", but xDebug reports the base class, A->Bar();

Additional Information

Issue happen on OS X 10.6.8, phpinfo reports the xDebug version as 2.2.0rc1, happens with Stock OS X PHP with an xDebug installed via pecl. Full phpinfo() output printed and attached as PDF.

TagsNo tags attached.
Attached Files
phpinfo.pdf (692,218 bytes)
Operating SystemOS X 10.6.8
PHP Version5.3.6

Activities

derick

2013-06-09 10:22

administrator   ~0002500

I did have a look at this, but it isn't as easy to solve as I thought. More tinkering required.

derick

2017-05-08 18:48

administrator   ~0004341

Fixed for PHP 7.0/7.1 in Xdebug 2.5.4. The problem remains for PHP 5,
but as this is not a critical bug, I won't be fixing it.

Issue History

Date Modified Username Field Change
2012-03-18 22:42 astorm New Issue
2012-03-18 22:42 astorm File Added: phpinfo.pdf
2012-03-21 10:22 derick Target Version => 2.2.1
2012-07-14 22:14 derick Target Version 2.2.1 => 2.2.2
2013-03-23 14:50 derick Target Version 2.2.2 => 2.2.3
2013-05-22 03:51 derick Target Version 2.2.3 => 2.2.x
2013-06-09 10:22 derick Note Added: 0002500
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2016-11-28 20:59 derick Assigned To => derick
2016-11-28 20:59 derick Status new => confirmed
2017-05-08 18:48 derick Note Added: 0004341
2017-05-08 18:48 derick Status confirmed => closed
2017-05-08 18:48 derick Resolution open => fixed
2017-05-08 18:48 derick Fixed in Version => 2.5.4
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized