Found a problem using phpStorm to debug local variables

Hello,

First post - not sure if this is the right place to share but I’d like to help others from losing days of productivity like I did :-).

Thought I was going crazy! Debugging a new PHP plugin in WordPress (version 5.2.2) using LBFW (version 3.2.1) and phpStorm (version 2019.1.3), I was unable to see values for local variables inside a function unless they were declared global. What??

After MUCH experimenting, I found that using the PHP version 7.2 (xdebug version 2.6.0-dev) & 7.3.2 (debug version 2.7.0RC2) [both Apache & nginx behaved the same] libraries in LBFW were the problem. If I used PHP version 7.0.3 (xdebug version 2.4.0) or lower - presto - the value for local variables showed up in debug as expected.

Not sure if you guys can do anything about that, but maybe someone who knows more than I do about xdebug dev can forward this info.

Thanks!!

1 Like

Thanks for tracking that down @DougF – I can only imagine the headache of trying different versions and configurations!

Seems like this is an Opcache issue, and not a Local/WP Engine issue. It appears like it is resolved in Xdebug 2.7.0beta1.

https://bugs.xdebug.org/view.php?id=1609