Skip to content

Instantly share code, notes, and snippets.

@tamakiii
Created August 21, 2015 02:45
Show Gist options
  • Save tamakiii/fb3bf3ca54cd69fb48f7 to your computer and use it in GitHub Desktop.
Save tamakiii/fb3bf3ca54cd69fb48f7 to your computer and use it in GitHub Desktop.
<?php
function simple_backtrace()
{
$map = function($row) {
$filter = function($k) {
return in_array($k, ['function', 'class', 'file', 'line', 'type']);
};
return array_filter($row, $filter, ARRAY_FILTER_USE_KEY);
};
$backtrace = debug_backtrace();
array_shift($backtrace);
return array_map($map, $backtrace);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment