New in Symfony 2.3: New Debug Component

Warning: This post is about an unsupported Symfony version. Some of this information may be out of date. Read the most recent Symfony Docs.

Contributed by
Fabien Potencier
in #7441.

Since the introduction of Symfony2, we have tried to decouple features as much as possible to make useful features easily reusable outside the context of Symfony. And because Composer makes it easy to add a dependency to your project, we have decided to extract the debug feature from HttpKernel to create a new Debug component.

The new Debug Component provides tools to ease debugging PHP code. Enabling all tools is as easy as it can get:

use Symfony\Component\Debug\Debug;


The enable() method registers an error handler and an exception handler. If the ClassLoader component is available, a special class loader is also registered.

Here is how you can only register the error handler:

use Symfony\Component\Debug\ErrorHandler;


And here is how you can register the exception handler:

use Symfony\Component\Debug\ExceptionHandler;


Documentation has also been updated, but the pull request has not been merged yet.

Have a look at the code on Github, and use symfony/debug in your composer.json file.

The Symfony Standard Edition has also been updated to reflect these changes.

Help the Symfony project!

As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.


Awesome. This will be useful. Thanks for the info.
Awesome. As usual :-)
Wow nice!
It seems the api is not updated. Giving a 404.

Thank you.

Comments are closed.

To ensure that comments stay relevant, they are closed for old posts.