private function stackTrace($stack)
    {
        $counter = count($stack);
        $lines = array();
        foreach ($stack as $frame) {
            $ret = 'Frame #' . $counter . ' - ';
            $line = isset($frame['line']) ? $frame['line'] : 0;
            $file = isset($frame['file']) ? $frame['file'] : 'Unknown file';
            $args = isset($frame['args']) ? $frame['args'] : array();
            $ret .= 'File ' . $file . ', Line ' . $line 
                . ', function ' . $this->frameToFunction($frame);
            $lines[] = $ret;
            $counter--;
        }

        return $lines;
    }