From d7177f246e63afb2777eb8418cc4e5e3c17e9698 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Fri, 21 Sep 2007 15:27:13 +0000 Subject: Streamline dumping of debug info --- it_debug.class | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'it_debug.class') 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); } } -- cgit v1.2.3