diff options
author | Andreas Gohr <andi@splitbrain.org> | 2007-04-18 19:41:51 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2007-04-18 19:41:51 +0200 |
commit | 8259f1aaaef4999ee39e56e49f894edb4252031a (patch) | |
tree | e67054a6a52ab247f6fef09425a88e8ada9ca9b3 | |
parent | 7c7ba7a2e51f6e4af42576bc7a9706e5d7ce0408 (diff) | |
download | rpg-8259f1aaaef4999ee39e56e49f894edb4252031a.tar.gz rpg-8259f1aaaef4999ee39e56e49f894edb4252031a.tar.bz2 |
fix dbg_backtrace when arguments are an array or object
darcs-hash:20070418174151-7ad00-834f13a1a0c84254cf98058c3e6db223187598ed.gz
-rw-r--r-- | inc/infoutils.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/inc/infoutils.php b/inc/infoutils.php index d6da2989d..255b49ed4 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -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); |