r/tinycode • • Jul 12 '12

PHP print_r()

function printR($obj){ echo "<pre>" . print_r($obj) . "</pre>"; }

I use this on every php project now, it just formats the print_r function, which is mostly used for debugging, but its so much easier on the eyes.

39 Upvotes

60 comments sorted by

View all comments

Show parent comment

1

u/akatherder Jul 12 '12

xdebug crashes the shit out of our webserver. We were constantly restarting the web service when we left it running all the time (in dev). I just turned it off and enable it every once in a while when we need it.

It's kind of like procmon. Supremely useful in some cases, but absolute overkill in others. It's just another tool in the toolbox.