Skip to content

Instantly share code, notes, and snippets.

@tott
Created September 24, 2012 10:44
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 tott/3775415 to your computer and use it in GitHub Desktop.
Save tott/3775415 to your computer and use it in GitHub Desktop.
mini backtrace
function mini_backtrace( $log = true ) {
$trax = array();
$trace = debug_backtrace();
foreach ( $trace as $key => $trc ) {
$trax[$key] = '[' . $key . '] : ' . $trc['file'] . '::' . $trc['line'] . ' - ' . $trc['function'];
}
if ( true === $log )
error_log( var_export( $trax, true ) );
return $trax;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment