For my current gig, we have several scripts that need to run that take forever to finish. I'm talking hours. Obviously, doing them through the browser would be impossible, so we use command line php scripts to make sure they can finish completely. Last Friday, I was having issues with one of these, but didn't know why it was erroring out. I could have done a bunch of var_dumps and whatever to try and figure it out, but I wanted to be able to just put a breakpoint in the script and figure out exactly where it was happening in a lot less time.
Thankfully, the answer was pretty simple and easy to find over on Stack Overflow. The one that I ended up going with was actually the second answer. Here it is if you don't want to bother clicking through:
That's it. Super simple, but if you're using command line scripts, it's really useful.
If you want to turn it off again, just enter this. The CLI instance of PHP will stop debugging, but your browser will still be going like normal until you stop that session:
Hope this helps people! Enjoy!