Issues with arrays in the watch window
3 posts
• Page 1 of 1
Issues with arrays in the watch window
Hi there,
I have the following code:
In the watch window, when I put in $array[5] it shows the correct value of 'six', but when I put in $array[$i] it shows the entire array:
When I echo $array[$i] it returns the correct value of 'six' to the browser.
This would seem to be an issue?
Regards,
Scott
I have the following code:
- Code: Select all
$i = 5;
$array = array('One','Two','Three','Four','Five','Six','Seven','Eight','Nine','Ten');
echo($array[$i]);
In the watch window, when I put in $array[5] it shows the correct value of 'six', but when I put in $array[$i] it shows the entire array:
When I echo $array[$i] it returns the correct value of 'six' to the browser.
This would seem to be an issue?
Regards,
Scott
- codeowl
- Posts: 51
- Joined: February 10th, 2013, 10:05 am
Re: Issues with arrays in the watch window
Hi Scott,
Sorry it took me few days to respond, I must have somehow missed this post.
The issue you are explaining happens because one limitation XDebug has. It's kind of low level, but I'll try to explain anyway. It can only return a value for identifier (not an more complex expression) on the given stack.
So it's not able to evaluate expressions for other than top level stack frame. But in VS you can switch your stack frame in call stack window.
If you for example try this in Immidiate window it will evaluate it correctly, because only top level stack is considered there even if you've chosen another stack frame.
However we know about this limitation and we've designed method how to overcome this. It'll be available in one of the future updates.
Thanks,
Miloslav
Sorry it took me few days to respond, I must have somehow missed this post.
The issue you are explaining happens because one limitation XDebug has. It's kind of low level, but I'll try to explain anyway. It can only return a value for identifier (not an more complex expression) on the given stack.
So it's not able to evaluate expressions for other than top level stack frame. But in VS you can switch your stack frame in call stack window.
If you for example try this in Immidiate window it will evaluate it correctly, because only top level stack is considered there even if you've chosen another stack frame.
However we know about this limitation and we've designed method how to overcome this. It'll be available in one of the future updates.
Thanks,
Miloslav
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Issues with arrays in the watch window
Hi Scott,
this was implemented in the current preview version http://www.devsense.com/products/php-tools/download/preview.
Thanks,
this was implemented in the current preview version http://www.devsense.com/products/php-tools/download/preview.
Thanks,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 215 guests