private static function _errorBacktrace($debug_array = NULL)
    {
        if ($debug_array == NULL) {
            $debug_array = debug_backtrace();
        }
        $counter = count($debug_array);
        $msg = "";
        for ($tmp_counter = 0; $tmp_counter != $counter; ++$tmp_counter) {
            $msg .= "<br><b>function:</b> ";
            $msg .= $debug_array[$tmp_counter]["function"] . " ( ";
            //count how many args a there
            $args_counter = count($debug_array[$tmp_counter]["args"]);
            //print them
            for ($tmp_args_counter = 0; $tmp_args_counter != $args_counter; ++$tmp_args_counter) {
                $a = $debug_array[$tmp_counter]["args"][$tmp_args_counter];
                switch (gettype($a)) {
                    case 'integer':
                    case 'double':
                        $msg .= $a;
                        break;
                    case 'string':
                        //$a = htmlspecialchars(substr($a, 0, 64)).((strlen($a) > 64) ? '...' : '');
                        //$msg .= "\"$a\"";
                        $a = htmlspecialchars($a);
                        $msg .= "\"$a\"";
                        break;
                    case 'array':
                        $msg .= 'Array(' . count($a) . ')';
                        break;
                    case 'object':
                        $msg .= 'Object(' . get_class($a) . ')';
                        break;
                    case 'resource':
                        $msg .= 'Resource(' . strstr($a, '#') . ')';
                        break;
                    case 'boolean':
                        $msg .= $a ? 'True' : 'False';
                        break;
                    case 'NULL':
                        $msg .= 'Null';
                        break;
                    default:
                        $msg .= 'Unknown';
                }
                if (($tmp_args_counter + 1) != $args_counter) {
                    $msg .= (", ");
                } else {
                    $msg .= (" ");
                }
            }
            $msg .= ") @ ";
            if (isset($debug_array[$tmp_counter]["file"])) {
                $msg .= ($debug_array[$tmp_counter]["file"] . " ");
            }
            if (isset($debug_array[$tmp_counter]["line"])) {
                $msg .= ($debug_array[$tmp_counter]["line"]);
            }
            if (($tmp_counter + 1) != $counter) {
                $msg .= "\n";
            }
        }
        return $msg;
    }