protected function _backtrace_formatArgsHelper($arg) {
        $value = $arg;
        if (is_object($arg)) {
            $value = sprintf('OBJECT(%s)', get_class($arg));
        } elseif (is_resource($arg)) {
            $value = 'RESOURCE';
        } elseif (is_array($arg)) {
            $value = 'ARRAY[%s](%s)';
            $c = array();
            foreach ($arg as $k => $v) {
                $c[] = sprintf('%s => %s', $k,
                    $this->_backtrace_formatArgsHelper($v));
            }
            $value = sprintf($value, count($arg), implode(', ', $c));
        } elseif (is_string($arg)) {
            $value = sprintf('\'%s\'', $arg);
        } elseif (is_bool($arg)) {
            $value = $arg ? 'TRUE' : 'FALSE';
        } elseif (is_null($arg)) {
            $value = 'NULL';
        }
        return $value;
    }