-
-
Save martinandersen3d/02afef88a86d892947f8e4a3a786568e to your computer and use it in GitHub Desktop.
Printing a clean debug backtrace in PHP.
This file contains hidden or 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
// PHP < 5.3.6 | |
foreach (debug_backtrace() as $trace) | |
{ | |
echo sprintf("\n%s:%s %s::%s", $trace['file'], $trace['line'], $trace['class'], $trace['function']); | |
} | |
die; | |
// PHP >= 5.3.6 | |
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); | |
die; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment