Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getTrace()
- {
- $v = function ($a, $k) { return array_key_exists($k, $a) ? $a[$k] : ''; };
- $s = [];
- $tr = debug_backtrace();
- array_shift($tr);
- foreach ($tr as $h => $e) {
- $s [] = vsprintf('#%d %s:%s %s%s%s()', [ ++$h, $e['file'], $e['line'], $v($e, 'class'), $v($e, 'type'), $e['function'] ]);
- }
- return implode(PHP_EOL, $s);
- }
Advertisement
Add Comment
Please, Sign In to add comment