Skip to content

Instantly share code, notes, and snippets.

@antongorodezkiy
Created January 30, 2014 12:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antongorodezkiy/8707212 to your computer and use it in GitHub Desktop.
Save antongorodezkiy/8707212 to your computer and use it in GitHub Desktop.
debug_backtrace() with files and lines only
<?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