2

I'm playing with PHPStorm and XDebug. All is working fine, except for an odd quirk:

If I set a breakpoint before launching the script, or while it is already paused, everything works fine. But if I set the breakpoint while the script is running, it is never hit. PHPStorm also doesn't mark it with a checkbox like it does with the working breakpoints. In addition, the "Pause program" option also doesn't work.

It appears that I need to specify in advance, before running the script, where I'll want it to stop next.

My colleague who uses Zend Studio and Zend Debugger also says that this has been the case as long as he can remember.

On the other hand, searching the Internet for this kind of behavior yields nothing. This is odd, I would think that people would have noticed something like that and written about it.

Is there something odd about our script then? It's really not doing much - just looping and calling sleep(1), waiting for a signal. Perhaps you cannot pause a sleeping PHP script? But no, that doesn't yield any search results either.

Anybody have any idea why the debugger behaves this way?

Vilx-
  • 104,512
  • 87
  • 279
  • 422
  • 1
    I would expect this behavior, similarly to how modifying a php script or a class it is using during execution would not modify the behavior of that script. nice avatar – chiliNUT Aug 24 '17 at 12:51
  • Thanks! Yours is pretty good too! :) On the topic - this isn't modification of the script however. This is debugging. Now, I don't know how debugging is being done inside the PHP runtime, so maybe this is a known limitation. I do know that in many other programming languages this works as expected. It'd be nice if this was officially confirmed in some documentation. – Vilx- Aug 24 '17 at 12:56

0 Answers0