Now, these two buttons together are super powerful. You can essentially navigate the flow of your program with them, while keeping an eye on how variables change, why conditions match or don’t, how many times something is looped over, and much more.
But debugging is not just powerful; it’s also intimidating. There’s a lot going on, and it’s difficult to give examples without context that make sense. It’s also something that needs practice to get comfortable with, just like playing an instrument, for example.
So, here’s what we’re going to do. I’ve shown you the basics of getting started with the debugger: how to start a debugging session, breakpoints, and stepping over and into code. You’ll need to get comfortable with it, and the only way to do that is by practice. The next time you write a var_dump
or dd
statement, try to use the debugger instead; there will be some friction the first time you do, but it will get easier over time, and it will pay off in the long run.