Debug Toolkit
Debug Toolkit makes debugging your code easier and more enjoyable. It provides you with interactive and helpful tools: Better PHP error interface from ( Whoops ) Better variable inspection – no need to use var_dump , print_r , or X-debug An interactive way to back trace the program’s execution order
Debug Toolkit makes debugging your code easier and more enjoyable. It provides you with interactive and helpful tools:
- Better PHP error interface from ( Whoops )
- Better variable inspection – no need to use var_dump , print_r , or X-debug
- An interactive way to back trace the program’s execution order
Better PHP Error Interface from Whoops
The built-in PHP error container is basic and not as helpful as it could be. On top of that, it’s rather ugly. Wouldn’t you agree?
Whoops gives you a cool interface that is helpful, interactive, and quite nice to look at. Some features:
- Provides the error message and links to search Google, DuckDuckGo, and Stack Overflow.
- Shows the actual code where the error occurred.
- Provides an interactive call stack. Click each and the actual code appears in the viewer panel.
- Environment and details including GET Data, POST Data, Files, Cookie, Session, Server/Request Data, Environment Variables, and Registered Handlers.
See the tools in action in this video
Better Variable Inspection
Though X-debug is powerful, it can be difficult to set up and run. For that reason, it’s common to dump or print out the variable to browser. But the built-in display for the PHP var_dump and print_r is basic.
This plugin includes both two very popular variable dumper tools:
- VarDumper from Symfony
- Kint – a modern and powerful PHP debugging helper
VarDumper provides a simple container that displays where you place it.
On the other hand, Kint provides a more powerful interface that gives you more information such as printing out the expression that was passed into it, the data type, memory size, and the value.
To make it even easier, the following utility functions are available for you to use in your code:
Available Functions for Inspecting Variable Values
Let’s explore the functions that are available for you through this plugin. We’ll use the variable inspectors to dump global $post .