MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000799XdebugUsage problems (Wrong Results)public2012-03-18 22:422017-05-08 19:48
Reporterastorm 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS XOS Version10.6.8
Product Version2.2dev 
Target VersionFixed in Version2.5.4 
Summary0000799: xDebug Function Traces reports Base Class instead of Object Name
DescriptionWhen 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 Reproduce1. 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 InformationIssue 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
Attached Filespdf file icon phpinfo.pdf [^] (692,218 bytes) 2012-03-18 22:42

- Relationships

-  Notes
(0002500)
derick (administrator)
2013-06-09 11:22

I did have a look at this, but it isn't as easy to solve as I thought. More tinkering required.
(0004341)
derick (administrator)
2017-05-08 19:48

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 23: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 04:51 derick Target Version 2.2.3 => 2.2.x
2013-06-09 11:22 derick Note Added: 0002500
2016-07-31 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13: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 19:48 derick Note Added: 0004341
2017-05-08 19:48 derick Status confirmed => closed
2017-05-08 19:48 derick Resolution open => fixed
2017-05-08 19:48 derick Fixed in Version => 2.5.4


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker