IntelliJ IDEA 2017.3 Help

Debugging with PHP Exception Breakpoints

This feature is only supported in the Ultimate edition.

The following is only valid when PHP Plugin is installed and enabled!

In this section:

Configuring PHP Exception breakpoints

  1. On the main menu, choose Run | View Breakpoints, or press Ctrl+Shift+F8.
  2. In the Breakpoints dialog box that opens, click new.
  3. From the drop-down list, choose PHP Exception Breakpoint.
    ps create exception breakpoint
  4. In the Add Exception Breakpoint dialog box that opens, specify the errors or exceptions on which you want the debugger to suspend.
    • To break on PHP error conditions, choose one of the standard types from the drop-down list, the available options are Warning, Notice, or Deprecated.
    • Alternatively, specify a custom Exception type. Note that E_ERROR, E_PARSE, and E_COMPILE_ERROR are not handled as they halt execution of the PHP engine.
    Click OK when ready.

    IntelliJ IDEA returns you to the Breakpoints dialog box.

  5. Configure the new exception breakpoint as described in Configuring Breakpoints.

Examining the suspended program

When the debugger breaks on an error or an exception, IntelliJ IDEA sets a PHP Exception Breakpoint.

  • To see the breakpoint type, hover the mouse pointer over the breakpoint. The type is displayed in a pop-up window:
    ps_php_exception_breakpoint_tooltip.png
  • The Variables pane displays a fake Exception variable which shows the exception message and the exception code:
    ps_php_exception_breakpoint_fake_exception_variable.png
  • To get more information on PHP errors, add a watch for the error_get_last() function, see Adding, Editing and Removing Watches. Then the details of errors will be displayed in the Watches pane:
    ps_php_exception_breakpoint_watches.png
Last modified: 6 March 2018

See Also