diff options
Diffstat (limited to 'it_debug.class')
-rw-r--r-- | it_debug.class | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/it_debug.class b/it_debug.class index 61b4889..5069185 100644 --- a/it_debug.class +++ b/it_debug.class @@ -127,11 +127,17 @@ function dump($args) return "$r\n"; } -function backtrace() +function backtrace($skip = 0) { - foreach (array_slice(debug_backtrace(), 1) as $call) - $line .= basename($call['file']) . ":" . $call['line'] . " "; - return $line; + $result = array(); + + foreach (array_slice(debug_backtrace(), $skip + 1) as $call) + { + if ($call['file']) + $result[] = basename($call['file']) . ":" . $call['line']; + } + + return join(" ", $result); } } |