public static function dumpAsString($variable, $indentLevel = 0) {
        if (is_bool($variable)) {
            $result = $variable ? "true" : "false";
        } elseif (is_null($variable)) {
            $result = "null";
        } elseif (is_array($variable)) {
            $result = 'array (';

            foreach($variable as $key=>$item) {
                $result .= "\n". str_repeat(" ", ($indentLevel+1)*4);
                $result .= self::dumpAsString($key, $indentLevel+1);
                $result .= ' => ';
                $result .= self::dumpAsString($item, $indentLevel+1).',';
            }

            $result .= "\n".str_repeat(" ", ($indentLevel)*4).')';
        } elseif(is_string($variable) && (isset($variable[0]) && $variable[0] != '$')) {
            $result = '"'. (strpos($variable, '$__lv') === false ? str_replace('"', '\"', $variable) : $variable) .'"';
        } else {
            $result = $variable;
        }

        return $result;
    }