I had a similar problem with phpstorm 4.x / xdebug 2.2.3 / php 5.4.3
I could set a breakpoint in the code, and it would work, but as I went through the lines, I saw that the debugger was not synchronizing with the actual code. This meant that some breakpoints were skipped.
After a lot of experimentation, I finally decided that the problem was caused by the fact that I had line breaks in my var.
For instance:
$q = "SELECT * FROM table WHERE product_id = 'whatever' AND product_status != 'inactive'";
will discard the debugger for 4-5 lines when it comes to this statement.
Change this to:
$q = "SELECT * FROM table WHERE product_id = 'whatever' AND product_status != 'inactive'";
fixed problem!
Obviously, this will affect any var declaration with line breaks, and not just those intended for SQL queries. A bit of pain, because I do it for readability, but I hope it saves time for someone else with the same problem.
source share