$this variable not showing in variables perspective window

General discussion on Zend Studio
Post Reply
eric4289
Posts: 2
Joined: Thu Nov 13, 2014 3:32 am

$this variable not showing in variables perspective window

Post by eric4289 » Fri Jun 02, 2017 7:08 pm

Hi,

Hopefully I am asking a stupid question.

I typically use Xdebug as a debugger in Studio when debugging my Web apps.

Now I am developing a CLI application and I have set up my CLI debug environment to use Zend Debugger. As a step through code, it seems that the Variables window in the Debug perspective does not show the $this variable which is kind of pretty useful to inspect class properties.

Is there something that I am missing here? A missing setup parameter?

Thanks

Eric

bart8284
Posts: 38
Joined: Tue Nov 04, 2014 2:06 pm

Re: $this variable not showing in variables perspective wind

Post by bart8284 » Wed Jun 07, 2017 3:09 pm

Hello,

As a matter of fact Zend Debugger should present $this variable in Variables view but there is a situation in which you may not see $this variable as Zend Debugger engine does show it only for top stack frame (the most upper one in frames list available in Debug view). So if you selected one of the frames in the invocation stack which is not the top one, then $this will not be available. Can you confirm that $this variable is available while selecting the main/top frame? If it is not, please provide us some small test case that will help us to reproduce your issue and information about PHP version that you use.

With best regards

Bartlomiej Laczkowski
Zend Studio Team

eric4289
Posts: 2
Joined: Thu Nov 13, 2014 3:32 am

Re: $this variable not showing in variables perspective wind

Post by eric4289 » Wed Jun 07, 2017 5:17 pm

Bart,

Yes I selected the top frame in the stack and it does not appear. Must be a configuration error somewhere in my setup.

Here's the test case:
index.php.txt
Test case
(380 Bytes) Downloaded 164 times
And the screen shot in Studio 13.6. I am using the built-in PHP from Studio, which I believe is 7.1, and Zend Debugger.
CaptureZendStudio.JPG
Screen shot
CaptureZendStudio.JPG (165.96 KiB) Viewed 2597 times

Let me know what I am missing here.

Thanks
Eric

bart8284
Posts: 38
Joined: Tue Nov 04, 2014 2:06 pm

Re: $this variable not showing in variables perspective wind

Post by bart8284 » Thu Jun 08, 2017 6:11 pm

Hello Eric,

It looks like it is a bug, I was able to easily reproduce it so there is nothing wrong with your configuration. It looks like some changes in PHP 7.1.x broke our support for Zend Debugger ($this is visible while debugging with PHP 7.0.x). Thanks for this important finding, we will apply the fix for the next maintenance release.

Greetings

Bartlomiej Laczkowski
Zend Studio Team

Post Reply