Skip to content

Instantly share code, notes, and snippets.

@craiga
Created February 1, 2013 00:04
Show Gist options
  • Save craiga/4687895 to your computer and use it in GitHub Desktop.
Save craiga/4687895 to your computer and use it in GitHub Desktop.
<?php
/**
* Dump a simple view of the current call stack.
*
* @author Craig Anderson <[email protected]>
* @link https://gist.github.com/4687895
*/
function stackdump() {
$stack = debug_backtrace();
foreach($stack as $stackIndex => $stackEntry) {
printf("%d\t%s::%s\t%s:%d\n", $stackIndex, $stackEntry["class"], $stackEntry["function"], $stackEntry["file"], $stackEntry["line"]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment