If you work with PHP, chances are you work with arrays and boolean data. I’m sure we’ve all used
print_r() to show the data on the page to aid debugging and themeing, but i’m also sure we’ve all accidentally left something in when the site went live.
This is a function I add into all my PHP projects that prints arrays and boolean values in a big yellow box that;s hard to miss. It’s limited to 300px in height, but that max can be turned off by making the second attribute false.
The advantage to abstracting this is that you can simply comment out the echoed data and prevent anything going onto the page. If your framework has the concept of environments, you could also build it in so production never echoes this data.
It’s simple, and it works.