Created
January 30, 2014 12:09
-
-
Save antongorodezkiy/8707212 to your computer and use it in GitHub Desktop.
debug_backtrace() with files and lines only
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 | |
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