I decided not to have a full article on this topic, at least not yet anyway, so here's a quick look at debugging PHP using 3rd party applications.
FirePHP is an extension for Firefox which plugs in to the FireBug extension and what's useful about it is you can log anything to FireBug (unless there any PHP errors stopping the page from loading of course).
FirePHP is ideally suited for AJAX development where clean JSON or XML responses are required. All data is sent via a set of X-FirePHP-Data response headers. This means that the debugging data will not interfere with the content on your page.
That quote from the Mozilla Addons page pretty much sums up how useful it is. Personally that is the only thing I'd use it for.
Another way of debugging PHP is to use Xdebug. Using this instead you get the ability to do stack traces, and protection against infinite loops. I'm not too sure of the immediate advantages of this other than making it easier to follow what's happening in cases where the wrong value might be coming out of a function for example - everything else is easily debuggable from the PHP error messages anyway. Technically speaking, it is also possible for FirePHP to do this by using the FirePHP function inside each function to print the function name and the values of variables passed into it to the headers. Granted, there are downsides to doing that, but then I can't imagine why you'd want to do that anyway.













