Handy hint: easier PHP debugging Krumo ( like print_r / var_dump )


#1

I had to do some work recently quickly debugging a PHP app. I was using print_r to quickly output various objects and arrays to find the issue.

However some of these ojects/arrays were VERY large, which made finding the information tricky. I needed something like the chrome console JS object debugger but for PHP.

Enter Krumo…

!http://i.imgur.com/sA0Aa56.png!

it hasn’t been updated since 2007 but it works great. Just include the krumo class and use krumo() instead of print_r()

http://krumo.sourceforge.net/

Hope someone finds it useful.

(note: my debug page was 6MB of HTML markup after doing a few krumo() calls on large objects - page may take a while to load if you’re debugging a lot of info)


#2

Good find. Thanks!


#3

Thanks for sharing! I’ll give it a try.


#4

Personally, I prefer using var_dump(), together with the excellent XDebug, especially because the latter prints out a full backtrace when a fatal error occurs (something that PHP should do out of the box, but doesn’t do).