PHPStorm: Break on all PHP errors
7 August 2022 (Updated 13 November 2022)
Note: I think this will only break on errors like bad types or missing semi-colons. It won’t break on exceptions thrown by frameworks / libraries.
- Run -> View Breakpoints
- Click on the + icon
- Choose PHP Exception Breakpoints
- Type Error as the Exception name.
- Click on the + icon
- Choose PHP Exception Breakpoints
- Type RuntimeException as the Exception name.
Now, do something to throw an error (e.g., call an undefined method foobar()
) and PHPStorm should break when it encounters that error.
You can view the error by opening the Debugger
tab and examining the exception / error thrown.
Sources
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment