DEV Community

Discussion on: PHP features you use for debugging purposes ?

Collapse
 
po0q profile image
pO0q 🦄

The old print_r() is pretty convenient, so you may use like that:

echo "<pre>";
print_r($someVar);
echo "</pre>";
Enter fullscreen mode Exit fullscreen mode

It's definitely not the most modern way, but it works pretty much everywhere.

To go further, I recommend profiling the app with dedicated tools such as Blackfire. xdebug is really awesome for debugging too.