Last active
August 29, 2015 14:07
-
-
Save boecko/0b0ab4b288cbd6e2aec3 to your computer and use it in GitHub Desktop.
php simple stacktrace
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
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