Skip to content

Instantly share code, notes, and snippets.

@boecko
Last active August 29, 2015 14:07
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 boecko/0b0ab4b288cbd6e2aec3 to your computer and use it in GitHub Desktop.
Save boecko/0b0ab4b288cbd6e2aec3 to your computer and use it in GitHub Desktop.
php simple stacktrace
function stacktrace($linesep="<br>") {
$trace = debug_backtrace();
array_shift($trace); // stacktrace entfernen
$lines = array();
foreach($trace as $call) {
$lines[] = $call['file'] . " (" . $call['function'] . ")";
}
return join($linesep, $lines) . $linesep;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment