Debugger stepping over control statements when there are no braces

Answered

1) If(true)
2)   $a=1;
3) $a=2;

When stepping through the programming (over, into, force over, etc) the debugger jumps from line 1 to 3. If I change it to the following

1) If(true) {
2)   $a=1;
3) }
4) $a=2;

 it will correctly step from 1 to 2.

This also occurs in other control statements like for loops. Even breakpoints on the code inside the control statement are ignored when there are no braces.

I am using xdebug, which could be part of it I guess.

0
2 comments

Sigh. It's an xdebug bug that has been marked as unfixable for over 4 years. There is a fix in v2.5.1 of xdebug, but that version has not yet had a stable release.

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

1

Thanks for sharing this!

0

Please sign in to leave a comment.