[xdebug-general] context_get strange behaviour

From: Mauro C. <incastrix[@]yahoo.it>
Date: Sat, 16 Jun 2007 18:23:22 +0000 (GMT)

Hi Derick, hi to all,

During debug session I have notice an incorrect $this return value. Xdebug always return $this with the value of last stack frame in all stack frames.

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();

debugclient 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"?>

(cmd) run -i 5
<?xml version="1.0" encoding="iso-8859-1"?>

(cmd) stack_get -i 6
<?xml version="1.0" encoding="iso-8859-1"?>

(cmd) stack_get -i 7
<?xml version="1.0" encoding="iso-8859-1"?>

(cmd) context_get -i 8 -d 0
<?xml version="1.0" encoding="iso-8859-1"?>

(cmd) context_get -i 9 -d 1
<?xml version="1.0" encoding="iso-8859-1"?>

(cmd) context_get -i 10 -d 2
<?xml version="1.0" encoding="iso-8859-1"?>

Ciao
Mauro Casciari

      ___________________________________
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html
Received on Sat Jun 16 2007 - 20:23:37 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST