Debugging with functions.php

You can use var_dump() instead of print_r() – you get the type and the value of the variable and it will also work when your variable holds FALSE or NULL.

print_r( false ); # doesn't output anything
var_dump( false ); # output: bool(false)

print_r( NULL ); # doesn't output anything
var_dump( NULL ); # output: NULL

If you have arrays or objects to inspect, you could use a plugin like Kint Debugger to format the output into a more readable format.