Xdebug: debugging your PHP script

The free and open source Xdebug extension helps you debugging your script by providing a lot of valuable debug information. Xdebug is a PHP extension created by Derick Rethans, one of the PHP core developers.  Xdebug improves the way PHP displays error messages by automatically displaying a stack trace along with every PHP error message, warning and notice. This stack trace lists the history of function calls that lead to an error.

Xdebug
Xdebug

As PHP programs become more and more object-oriented, sometimes errors tend to show up deep inside libraries or helper objects. The stack trace allows you to quickly find out where the code piece that caused an error was originally called from. The debug information that Xdebug can provide includes the following:

  • Stack traces and function traces in error messages with:
    • Full parameter display for user defined functions
    • Function name, file name and line indications
    • Support for member functions
  • Memory allocation
  • Protection for infinite recursions
  • Profiling information for PHP scripts
  • Code coverage analysis
  • Capabilities to debug your scripts interactively with a debug client

Leave a Reply