Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000799XdebugUsage problemspublic2012-03-18 22:422013-03-23 14:50
Reporterastorm 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusnewResolutionopen 
PlatformOSOS XOS Version10.6.8
Product Version2.2dev 
Target Version2.2.3Fixed in Version 
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
There are no notes attached to this issue.

- 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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker