MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000283XdebugUsage problems (Wrong Results)public2007-06-18 16:562007-06-24 22:20
Reporterincastrix 
Assigned To 
PrioritynormalSeveritytrivialReproducibilityalways
StatusclosedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000283: incorrect $this return
DescriptionXdebug always return $this with the value of last stack frame in all stack frames.
Additional Informationcode:

class Application {
     private $driver;
    
     public function __construct(Driver $newDriver) {
         $this->driver = $newDriver;
     }
    
     public function execute() {
         $this->driver->doSomething("hello");
     }
}

class Driver {
    private $handler;
    
    public function doSomething($dummy) {
        echo $dummy;
    }
}

$app = new Application(new Driver());

$app->execute();


DBGp I/O:

(cmd) breakpoint_set -i 4 -t line -f file:///var/www/coop/stackframes.php [^] -n 18

<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<response xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" [^] command=\"breakpoint_set\" transaction_id=\"4\" id=\"124430063\"></response>

run -i 5

<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<response xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" [^] command=\"run\" transaction_id=\"5\" status=\"break\" reason=\"ok\"><xdebug:message filename=\"file:///var/www/coop/stackframes.php\" [^] lineno=\"18\"></xdebug:message></response>

stack_get -i 6

<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<response xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" [^] command=\"stack_get\" transaction_id=\"6\"><stack where=\"Driver->doSomething\" level=\"0\" type=\"file\" filename=\"file:///var/www/coop/stackframes.php\" [^] lineno=\"18\"></stack><stack where=\"Application->execute\" level=\"1\" type=\"file\" filename=\"file:///var/www/coop/stackframes.php\" [^] lineno=\"10\"></stack><stack where=\"{main}\" level=\"2\" type=\"file\" filename=\"file:///var/www/coop/stackframes.php\" [^] lineno=\"24\"></stack></response>

context_get -i 8 -d 0

<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<response xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" [^] command=\"context_get\" transaction_id=\"8\" context=\"0\"><property name=\"dummy\" fullname=\"$dummy\" address=\"8859120\" type=\"string\" size=\"5\" encoding=\"base64\"><![CDATA[aGVsbG8=]]></property><property name=\"$this\" fullname=\"$this\" address=\"8858496\" type=\"object\" children=\"1\" classname=\"Driver\" numchildren=\"1\"><property name=\"handler\" fullname=\"$this->handler\" facet=\"private\" address=\"8871744\" type=\"null\"></property></property></response>

context_get -i 9 -d 1

<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<response xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" [^] command=\"context_get\" transaction_id=\"9\" context=\"0\"><property name=\"$this\" fullname=\"$this\" address=\"8858496\" type=\"object\" children=\"1\" classname=\"Driver\" numchildren=\"1\"><property name=\"handler\" fullname=\"$this->handler\" facet=\"private\" address=\"8871744\" type=\"null\"></property></property></response>

context_get -i 10 -d 2

<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<response xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" [^] command=\"context_get\" transaction_id=\"10\" context=\"0\"><property name=\"app\" fullname=\"$app\" address=\"8858136\" type=\"object\" children=\"1\" classname=\"Application\" numchildren=\"1\"><property name=\"driver\" fullname=\"$app->driver\" facet=\"private\" address=\"8858496\" type=\"object\" children=\"1\" classname=\"Driver\" numchildren=\"1\"><property name=\"handler\" fullname=\"$app->driver->handler\" facet=\"private\" address=\"8871744\" type=\"null\"></property></property></property><property name=\"$this\" fullname=\"$this\" address=\"8858496\" type=\"object\" children=\"1\" classname=\"Driver\" numchildren=\"1\"><property name=\"handler\" fullname=\"$this->handler\" facet=\"private\" address=\"8871744\" type=\"null\"></property></property></response>
TagsNo tags attached.
Operating SystemDebian AMD64 lenny/sid
PHP Version5.2-dev
Attached Files

- Relationships

-  Notes
(0000669)
derick (administrator)
2007-06-24 22:20

Fixed in CVS, thanks for your report!

- Issue History
Date Modified Username Field Change
2007-06-18 16:56 incastrix New Issue
2007-06-24 22:20 derick Status new => closed
2007-06-24 22:20 derick Note Added: 0000669
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)


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker