You are browsing the Symfony 5.0 documentation, which changes significantly from Symfony 3.x. If your app doesn't use Symfony 5.0 yet, browse the Symfony 3.4 documentation.
The Debug Component
The Debug Component¶
The Debug component provides tools to ease debugging PHP code.
Deprecated since version 4.4: In Symfony versions before 4.4, this component also provided error and exception handlers. In Symfony 4.4 they were deprecated in favor of their equivalent handlers included in the new ErrorHandler component.
$ composer require --dev symfony/debug
If you install this component outside of a Symfony application, you must
vendor/autoload.php file in your code to enable the class
autoloading mechanism provided by Composer. Read
this article for more details.
The Debug component provides several tools to help you debug PHP code. Enable all of them by calling this method:
use Symfony\Component\Debug\Debug; Debug::enable();
You should never enable the debug tools in a production environment as they might disclose sensitive information to the user.
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.