RSS Element,demiblog Class,Language,Link,Title,Description channel,,en_GB,http://tobyinkster.co.uk/tag/debugging/,"Articles Tagged with ""Debugging""", item,B,en_GB,http://tobyinkster.co.uk/blog/2007/08/12/php-debugging-with-style/,12/08/2007: PHP Debugging with Style -OR- How I Learned to Stop Worrying and Love the Bug,"

PHP lets you define your own error handler, so I decided to get a bit fancy. MegaErrorHandler (MEH) outputs its errors as specially-formatted HTML comments, with the details of the error encoded using JSON.

A small client-side script, with an associated stylesheet then pulls this data out of the comments and formats it as a nice little interactive bug-viewing console, allowing you to view a stack trace for each bug, inspect superglobals, view the syntax-highlighted source code for the file where the error occurred, check the list of defined constants and other useful things…

"