Stepping is the process of controlling step-by-step execution of the program. PhpStorm provides a set of stepping actions, which are used depending on your strategy (for example, whether you need to go directly to the next line or enter the methods invoked on your way there). The stepping buttons are located on the Debug window
toolbar. Step overSteps over the current line of code and takes you to the next line even if the highlighted line has method calls in it. The implementation of the methods is skipped, and you move straight to the next line of the caller method.
If there are breakpoints inside the skipped methods, the debugger will stop at them. To skip any breakpoints on the way, use Force step over. Step intoSteps into the method to show what happens inside it. Use this option when you are not sure the method is returning a correct result.
If there are several method calls on the line, PhpStorm asks you which method to enter. This feature is called Smart step into. You can configure Smart Step Into to be automatically used every time when there are multiple method calls on the line. Alternatively, it can be invoked only when you expressly do so. Some scripts, methods, and functions are skipped by Step into as you normally might not need to debug them.
Skip some PHP methods
Smart step intoSmart step into is helpful when there are several method calls on a line, and you want to be specific about which method to enter. This feature allows you to select the method call you are interested in.
Step outSteps out of the current method and takes you to the caller method.
Run to cursorContinues the execution until the position of the caret is reached.
Also, you can Run to Cursor by clicking the line number in the gutter. You can configure whether you want Run to Cursor to work on clicking a line number in . To skip any breakpoints on the way, use Force run to cursor. Force step intoSteps in the method even if this method is skipped by the regular Step Into.
Force run to cursorContinues the execution until the position of the caret is reached. All breakpoints on the way are ignored.
Force step overSteps over the current line of code and takes you to the next line even if the highlighted line has method calls in it. If there are breakpoints in the called methods, they are ignored.
Improve stepping speedDebugger features consume resources and may impact stepping performance. If the performance is not satisfactory, follow the recommendations provided in this chapter to optimize it.
When a breakpoint is reached or your program is suspended, the Debug tool window becomes active and enables you to get control over the program's execution. For this purpose, you can use the menu commands, or the icons on the stepping toolbar of in the Debug tool window. Each stepping action advances the execution point to the next execution location, depending on the action you choose. Suppressing stepping intoYou can create a list of scripts, methods, and functions that you want the debugger skip while stepping through the program.
Skip some PHP methods
Tips and tricks
Last modified: 01 August 2022 How do I Debug PHP storm?Choose and install the browser extension suitable for your browser. On the PhpStorm toolbar, toggle. to start listening for incoming PHP debug connections, or choose Run | Start Listening for PHP Debug Connections from the main menu. Set a breakpoint in your code.
How do I open debug tool?There are three ways to open the debugger: Select the Debugger panel in the Web Developer Tools, accessible from the Browser Tools submenu. Press Ctrl + Shift + Z on Windows and Linux, or Cmd + Opt + Z on macOS (starting in Firefox 71; prior to Firefox 66, the letter in this shortcut was S ). Press the menu button.
How do I use Debug tools?Set a breakpoint and start the debugger.. Navigate code in the debugger using step commands.. Step over code to skip functions.. Run to a point in your code quickly using the mouse.. Advance the debugger out of the current function.. Run to cursor.. Restart your app quickly.. Live code editing.. What hotkey is used to set a breakpoint on the current line of code in Intellij running on Windows or Linux?A breakpoint will stop the execution of your program, so that you can analyze the state of your code. To set a breakpoint on a line of code, click in the gutter area or use the shortcut Ctrl+F8 ( Win/Linux) or ⌘ F8 (macOS).
|