Skip to content

Instantly share code, notes, and snippets.

@ahuggins
Last active November 28, 2016 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahuggins/5784bca19c25bbc7430aedbb5785b962 to your computer and use it in GitHub Desktop.
Save ahuggins/5784bca19c25bbc7430aedbb5785b962 to your computer and use it in GitHub Desktop.
die and dump rewrite
<?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;
}
@ahuggins
Copy link
Author

This allows for any number of args to be passed to dd or dump and it is in a readable format because of pre function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment