What is whoops?
Whoops is a good PHP error handling library. It provides a very nice error interface to help you debug web projects, but essentially it is a simple yet powerful stacked error handling system.
Features
Flexible, stack-based error handling
Separate library, no required dependencies (currently)
Simple API for handling exceptions, tracking frames and their data
Includes a pretty nice error page for your webapp project
Includes opening directly in editors and IDEs Features for referenced files
Includes handlers for different response formats (JSON, XML, SOAP)
Easy to extend and integrate with existing libraries
Clean, well-structured, and tested Passed code library
Whoops is an error capture and debugging PHP library suitable for PHP environments; whoops is very easy to use, it provides stackbased error capture and super-beautiful error viewing
Test effects As follows
Installation steps (composer installation)
After the installation is completed, create a new directory tools in the current directory, in the tools directory Create a new whoops.php and add the following code to register the monitoring class
require __DIR__."/../vendor/autoload.php"; $whoops = new \Whoops\Run; $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); $whoops->register(); 然后就可以测试了,代码如下,测试效果图如上
For more related knowledge, please visit PHP Chinese website! !
The above is the detailed content of What is whoops in php?. For more information, please follow other related articles on the PHP Chinese website!