Xdebug Break On Exception



Xdebug Break On Exception

As with normal exceptions, these Error exceptions will bubble up until they reach the first matching catch block. If there are no matching blocks, then any default exception handler installed with setexceptionhandler will be called, and if there is no default exception handler, then the exception will be converted to a fatal error and will be handled like a traditional error. Remove all breakpoints (or at least uncheck them) at Run View Breakpoints, leaving only the Exception one. Remove all debug watches if any. Update Xdebug to 2.9.4. Created April 07, 2020 11:49. Comment actions.

Xdebug break on exception
  • Fixed bug #305: xdebug exception handler doesn't properly handle special chars. + Changes: - Changed xdebugbreak to hint to the statement execution trap instead of breaking forcefully adding an extra stackframe. Prevent Xdebug 2.1.x to build with PHP 5.4. 2.1.2 = Fixed bugs.
  • In this case, a debugger engine would break (perhaps on an error or exception) and connect to the proxy. The proxy would then start the IDE (if it is not already running) and initiate a debugging session with it. The method for handling just in time debugging is not defined by the protocol and is.
  • Xdebugbreak : bool #. Emits a breakpoint to the debug client. This function makes the debugger break on the line it is called from, as if a normal file/line breakpoint was set on this line through the debugger protocol. If no debugging session is active yet, and xdebug.startuponrequest is set to trigger, then Xdebug will attempt to start.

With PHP Exception Breakpoints, you can initiate the debugger at the start of the script and break on your own breakpoints or whenever an error or Exception of a given type occurs. PHP Exception breakpoints do not require configuring Xdebug for working in the Just-In-Time mode by setting xdebug.remote_mode=jit (for Xdebug 2) or xdebug.start_upon_error=yes (for Xdebug 3) as described in Debug in the Just-In-Time mode.

ExceptionXdebug break on exception list

Xdebug Break On Exception Chrome

Configure PHP Exception breakpoints

  1. From the main menu, choose Run | View Breakpoints, or press Ctrl+Shift+F8.

  2. In the Breakpoints dialog that opens, click .

  3. From the list, choose PHP Exception Breakpoints.

  4. In the Add Exception Breakpoint dialog 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 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.

  5. When ready, click OK to returns you to the Breakpoints dialog.

  6. Configure the new exception breakpoint as described in Breakpoints.

Examine the suspended program

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

Php Xdebug Break On Exception

  • To see the breakpoint type, hover the mouse pointer over the breakpoint. The type is displayed in a popup:

  • The Variables pane displays a fake Exception variable which shows the exception message and the exception code:

  • To get more information on PHP errors, add a watch for the error_get_last() function, see Watches. Then the details of errors will be displayed in the Watches pane: