Hello there,
During development process I use
print_r($my_variable);
method to display variables.
However, sometimes the output of the code I'm debugging won't be shown (for instance when form is submitted and epesi is reloaded with location(array());), so I'm using trigger_error() method. I simply use print_r with return value switch in such case (notice that true passed as 2nd argument):
trigger_error(print_r($my_array, true));
This sometimes puts epesi in a state that will require you to reload epesi, but I believe that's a non-issue.
Hope this helps,
Arek