So far we have been talking about debugging PHP scripts by outputting info at one or more places in your code. Now it is time to look at a professional tool that will facilitate that activity. It also allows us to take things a step further.
Xdebug is a Zend extension that is able to hook into the internals of the PHP interpreter. With that ability comes added power over simply outputting debug information with echo statements. Among its many features, in this chapter we want to focus on the ones specifically designed to find, diagnose, and fix bugs. In particular, we will be looking at improved output of stack traces, function traces, and variables; as well as support for interactively debugging scripts locally and remotely.
In addition to the Xdebug features to be discussed below, it offers the following tools that we will look at in other chapters of this book:
Code Profiling allows you to optimize the performance of your application
Code Coverage Analysis feature will...