View Issue Details

IDProjectCategoryView StatusLast Update
0000799XdebugUncategorizedpublic2017-05-08 18:48
Reporterastorm Assigned To 
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.
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.