Toggle Breakpoint
What is Toggle Breakpoint?
Toggle Breakpoint: Set or clear a breakpoint on the current line so execution pauses there. Toggle Breakpoint sets or removes a breakpoint on the current line, the point where the debugger pauses execution. In VS Code press F9; in JetBrains IDEs, Ctrl+F8 or Cmd+F8. Clicking in the margin next to the line number works too.
Frequently asked questions about Toggle Breakpoint
How is Toggle Breakpoint used in practice?
When execution reaches the breakpoint, everything stops, and you can inspect variables, the call stack and expressions at that exact moment.
What should you keep in mind with Toggle Breakpoint?
Right-click a breakpoint for more options. A conditional breakpoint only pauses when an expression is true, such as $order->id === 4821, which is invaluable in loops. A logpoint prints a message without stopping, like a temporary log line that never needs to be removed from the code. Clear old breakpoints now and then, so the debugger does not stop in places you have long forgotten about.
At a glance
| Category | Keyboard shortcuts |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |