Last active
November 28, 2016 19:09
-
-
Save ahuggins/5784bca19c25bbc7430aedbb5785b962 to your computer and use it in GitHub Desktop.
die and dump rewrite
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
<?php | |
function dump() | |
{ | |
array_map('pre', func_get_args()); | |
} | |
function pre($to_dump) | |
{ | |
echo "<pre>"; | |
print_r($to_dump); | |
echo "</pre>"; | |
} | |
function dd() | |
{ | |
array_map('pre', func_get_args()); | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This allows for any number of args to be passed to
dd
ordump
and it is in a readable format because ofpre
function.