Last active
August 29, 2015 14:09
-
-
Save NickBusey/5645ec50564db82750f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dbg($input) { | |
echo "<pre>"; | |
print_r($input); | |
} | |
function dbgd($input='--Die--') { | |
dbg($input); | |
die(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These are the first bits of code I paste into any new PHP project, whatever platform it's written in. I usually put them in the very first bit of PHP that gets loaded on the webserver. For CakePHP 3+ that's in app/webroot/index.php
Now anytime you want to debug something just: dbg($OUTPUT);
If you want to debug something and stop what's happening afterwards: dbgd($OUTPUT);