Last active
August 29, 2015 14:17
-
-
Save awgeorge/b2bd3a795aa6fee95fb0 to your computer and use it in GitHub Desktop.
\pre_r("quick", "debugging");
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
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