Skip to content

Instantly share code, notes, and snippets.

View awgeorge's full-sized avatar
🇬🇧

William George awgeorge

🇬🇧
View GitHub Profile
@awgeorge
awgeorge / pre_r
Last active August 29, 2015 14:17
\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";
}
}
}