Skip to content
Snippets Groups Projects
Commit 8259f1aa authored by Andreas Gohr's avatar Andreas Gohr
Browse files

fix dbg_backtrace when arguments are an array or object

darcs-hash:20070418174151-7ad00-834f13a1a0c84254cf98058c3e6db223187598ed.gz
parent 7c7ba7a2
No related branches found
No related tags found
No related merge requests found
......@@ -277,12 +277,23 @@ function dbg_backtrace(){
$function = (isset($call['class'])) ?
$call['class'] . $call['type'] . $call['function'] : $call['function'];
$params = '';
if (isset($call['args'])) {
$params = implode(', ', $call['args']);
$params = array();
if (isset($call['args'])){
foreach($call['args'] as $arg){
if(is_object($arg)){
$params[] = '[Object '.get_class($arg).']';
}elseif(is_array($arg)){
$params[] = '[Array]';
}elseif(is_null($arg)){
$param[] = '[NULL]';
}else{
$params[] = (string) '"'.$arg.'"';
}
}
}
$params = implode(', ',$params);
$calls[$depth - $i] = sprintf('%s(%s) called at [%s]',
$calls[$depth - $i] = sprintf('%s(%s) called at %s',
$function,
str_replace("\n", '\n', $params),
$location);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment