[xdebug-general] Re: $this construct crashes the debugger

From: Hando Tint <hando[@]vihmapuu.ee>
Date: Mon, 15 May 2006 11:24:37 +0300

>>2) if I am for example in main thread (not in an object method) and ask for
>>variable $this->somethingthatdoesnotexist then I get to _xdebug_do_eval.
>>res = zend_eval_string(eval_string, ret_zval, "xdebug eval" TSRMLS_CC);
>>will crash and eval_string does have that $this... so something in Zend is
>I can not reproduce this, so I'd need some more information:
>- Which PHP version are you using?
>- What is the test script?
>- Which *exact* DBGp commands did you issue (a remote_log file would be
Ok, I took the latest dll on the page (just in case I build my version
wrong) and now understood which fact I forgot to mention.

The crash happens when asking for a property from $this when actually in
the main program, not class method. So $this is actually nothing and
asking for it
does not make sense. So it is kind of a pseudoissue, I just had
$this-property in my watch list when exiting to {main}.

So to reproduce this:

1) create any kind of script for example
2) set a breakpoint to the first line
3) ask: property_get -n $this->bla -i 1

I'm not even sure if this is a bug, I could not really find in
documentation which part of error checking should the IDE do. For me it
was enough that before asking for $this (or any object for that matter)
I first
ask for itself (property_get -n $this -i 1) and if I get a non-empty
answer only after then I ask for properties.

If you still cannot reproduce it, then it is probably just me :).

Thank you
Hando Tint
Received on Mon May 15 2006 - 10:24:50 BST

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