Skip to content

Instantly share code, notes, and snippets.

@awgeorge
Last active August 29, 2015 14:17
Show Gist options
  • Save awgeorge/b2bd3a795aa6fee95fb0 to your computer and use it in GitHub Desktop.
Save awgeorge/b2bd3a795aa6fee95fb0 to your computer and use it in GitHub Desktop.
\pre_r("quick", "debugging");
namespace {
function pre_r(){
$traces = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)[0];
$caller = basename($traces['file']).':'.$traces['line'];
foreach(func_get_args() as $print){
print "<pre>[$caller] ".htmlentities(print_r($print && $print !== true?$print:var_export($print, true), true))."</pre>\n";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment