View Issue Details

IDProjectCategoryView StatusLast Update
0000283XdebugUncategorizedpublic2007-06-24 21:20
Reporterincastrix Assigned To 
PrioritynormalSeveritytrivialReproducibilityalways
Status closedResolutionopen 
Summary0000283: incorrect $this return
Description

Xdebug always return $this with the value of last stack frame in all stack frames.

Additional Information

code:

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\&quot; 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\&quot; 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\&quot; 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\&quot; 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\&quot; 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\&quot; 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

Activities

derick

2007-06-24 21:20

administrator   ~0000669

Fixed in CVS, thanks for your report!

Issue History

Date Modified Username Field Change
2007-06-18 15:56 incastrix New Issue
2007-06-24 21:20 derick Status new => closed
2007-06-24 21:20 derick Note Added: 0000669
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)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized