If you are writing any code in Joomla then I would highly recommend installing J!Dump for debugging
Advanced print_r and var_dump replacer with DHTML tree display. This utility makes life easy for developers and template designers. You use it to see what's inside a variable, an array or an object. Instead of using print_r() or var_dump(), you can now use dump().