-
-
Save farik92/cca4d01805091ee32c0d3cf6797544b3 to your computer and use it in GitHub Desktop.
debug_backtrace() with files and lines only
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 | |
| function backtrace() { | |
| $keys = array('file','line'); | |
| $target = array(); | |
| foreach(debug_backtrace() as $key => $s) { | |
| /*if ($key == 0) { | |
| continue; | |
| }*/ | |
| foreach($s as $inner_key => $inner_s) { | |
| if (in_array($inner_key,$keys)) | |
| $target[$key][$inner_key] = $inner_s; | |
| } | |
| } | |
| return $target; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment