public static function render($mixed)
    {
        if (!is_array($mixed) && !is_object($mixed)) {
            return strpos(str_replace(' ', '', $mixed), 'function(') === 0 ? $mixed : json_encode($mixed);
        }

        $isNumArr = array_keys((array) $mixed) === range(0, count((array) $mixed) - 1);
        $isObject = is_object($mixed) || (!$isNumArr && !empty($mixed));

        $r = array();
        $i = 0;
        foreach ($mixed as $k => $m) {
            $r[$i] = ($isObject ? self::renderObjectKey($k).':' : '').self::render($m);
            ++$i;
        }

        return  ($isObject ? '{' : '[').implode(',', $r).($isObject ? '}' : ']');
    }