PhpStorm wont debbug my if(isset) code

Hi there all,

I got an issue with the PhpStorm debbuging my firefox I use the easiestXdebug 2.1 Plug-In and actually, most runs fine. Well, in my PHP Code I set some breakpoints beginning
at an if(isset (.....code)) line. So...logical...the debugger does not evaluate the code statements inside the block until this particular $var is set.

Normally I suppose to do something to make this $var exist (here clicking on a link)...

How do I persuade PhpStorm to evaluate that code block or what is necessary to tell the IDE that this if(isset()) is now true ???

Thanks for each advice

1 comment
Comment actions Permalink

Hi there,

Well -- AFAIK you cannot force debugger to get inside that code block just like that as it's only done by evaluating the actual code.

In any case: it depends on the actual conditions in if statement . For example, this is what you can do for array keys (can be applied to variables as well):

$array = [
    0 => 'zero',
    1 => 'one',
    2 => 'two'

$array[1] = 'one-one'; // breakpoint here

if (isset($array[5])) {
    $array[20] = 'twenty';

Before executing "if (isset($array[5])) {" line, use Evaluate Expression functionality:


And now it's working:



Please sign in to leave a comment.