Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Richard Davey's Blog:
dBug - var_dump with style!
Feb 10, 2006 @ 06:56:14

Richard Davey has posted this new item today to share a helpful tool for debugging your PHP scripts without having to purchase an expensive debugger package - dBug.

When it comes to debugging PHP applications most developers fall into one of two camps. They either use a package such as Zend Debugger, set breakpoints and painstakingly go through their code checking the variable values. Or alternatively for those of you not using $200 worth of IDE, and a common method employed by more php 'beginners', they will print_r() and var_dump() all over the place to check what is going on, the resulting dumps appearing inline with the rest of the site.

Personally, I use both methods, and I imagine most other developers are in the same boat. When you need a quick variable output or to see the full contents of an array you often can't beat var_dump for speed of implementation. Which is why this superb little class file that was recently bought to my attention (thanks Chris!) should be of interest to you all.

He gives some visual examples of how the output from this powerful little script works, including the simple three-line code to make it happen. The library really shines when it comes time it echo out more complex data, creating easy to read tables of information versus the normal difficult to read var_dump/print_r output.

You can find dBug at http://dbug.ospinto.com/.

tagged: var_dump style dBug library table ouput print_r var_dump style dBug library table ouput print_r