summaryrefslogtreecommitdiff
path: root/it_debug.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_debug.class')
-rw-r--r--it_debug.class14
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);
}
}