![]() In the Debug tool window, open the Settings menu and unselect the Enable Function Return Value Debugging option. To disable it, do either of the following: Return value debugging is enabled in PhpStorm by default. The additional variable is now available for inspection in the Variables tab of the Debug tool window in a watch. The debugger will suspend execution at the last statement in the function.Ĭlick Step Into on the Debug toolbar ( F7). Set a line breakpoint at the return statement line. To run Xdebug return value debugging in PhpStorm: This is an extra debugging step for inspection of return values in functions that return them immediately without storing in intermediate variables. ![]() With Xdebug 3.2 and later, PhpStorm supports Xdebug's return value debugging feature. To get an in-depth technical overview of how breakpoints resolving works, refer to this article and DBGP documentation. In the Settings area, unselect the Notify if breakpoint was resolved to a different line (Xdebug 2.8+) checkbox to turn off PhpStorm notifications every time when a breakpoint is resolved. Note that the breakpoint resolving feature will still be enabled. Unselect the Move breakpoint to resolved position if it's different from the source checkbox to disable only automated adjustment of the breakpoint position to the line where Xdebug actually stops after resolving the breakpoint. ![]() Note that if resolving is disabled, the breakpoints set on the code lines without executable code will always be ignored. Unselect the Resolve breakpoint if it's not available on the current line (Xdebug 2.8+) checkbox to disable the entire breakpoint resolving feature. If you don't want PhpStorm to resolve and move breakpoints during debugging sessions, you can disable this feature on the PHP | Debug page of the Settings dialog ( Control+Alt+S). When you run a debugging session, PhpStorm moves the breakpoint to line 5 where it is resolved, suspends the session, and displays a corresponding notification. In the following example, the breakpoint is placed on line 4, which doesn't contain any executable code: Xdebug will scan up to 5 subsequent lines, stop at the line where executable code is located, and update the breakpoint definition to this line. If there is no such code on the line that the breakpoint refers to, the corresponding breakpoint cannot be hit. Under this mechanism, the debugger evaluates whether PHP can generate internal executable bytecode for the current line. When using Xdebug (2.8 and later), PhpStorm employs its breakpoints resolving mechanism. In the Add Exception Breakpoint dialog, specify the exception class.įor more information, refer to Debug with PHP exception breakpoints. In the Breakpoints dialog, press Alt+Insert or click, and select PHP Exception Breakpoints or JavaScript Exception Breakpoint. In the Add Method Breakpoint dialog, specify the class and the method, or the plain function to add a breakpoint for. In the Breakpoints dialog that opens, press Alt+Insert or click, and select PHP Method Breakpoints. Press Control+Shift+F8 or select Run | View Breakpoints from the main menu. Alternatively, place the caret at the line and press Control+F8. Alternatively, place the caret at the line and press Control+F8.Ĭlick the gutter at the line where the method is declared. They apply globally to the exception condition and do not require a particular source code reference.Ĭlick the gutter at the executable line of code where you want to set the breakpoint. Method breakpoints: suspend the program upon entering or exiting the specified method or one of its implementations, allowing you to check the method's entry/exit conditions.Įxception breakpoints: suspend the program when Exception or its subclasses are thrown. This type of breakpoints can be set on any executable line of code. Line breakpoints: suspend the program upon reaching the line of code where the breakpoint was set. The following types of breakpoints are available in PhpStorm: Note that PhpStorm must be running when such changes are made, otherwise they will pass unnoticed. If a file with breakpoints was modified externally, for example, updated through a VCS or changed in an external editor, and the line numbers have changed, breakpoints will be moved accordingly. Once set, a breakpoint remains in your project until you remove it explicitly, except for temporary breakpoints. Breakpoints can be simple (for example, suspending the program on reaching some line of code) or involve more complex logic (checking against additional conditions, writing log messages, and so on). This lets you examine the program state and behavior. ![]() Breakpoints are special markers that suspend program execution at a specific point.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |