-
-
Save marcelovani/4e0d5efc48973b860ccd318e01ab035b to your computer and use it in GitHub Desktop.
A very lightweight php backtrace
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
<?php | |
$debug_backtrace = debug_backtrace(); | |
$output = []; | |
foreach ($debug_backtrace as $debug) { | |
if (isset($debug['class'])) { | |
$o = $debug['class']; | |
} | |
$o .= '::' . $debug['function']; | |
if( isset( $debug['file'] ) ){ | |
$o .= ' (' . $debug['file'] . ':' . $debug['line'] . ')'; | |
} | |
$output[] = $o; | |
} | |
var_dump($output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment