protected function deepClone($vars)
    {
        if (is_object($vars)) {
            $vars = get_object_vars($vars);
            foreach ($vars as $key => $value) {
                if (is_array($value) || is_object($value)) {
                    $vars[$key] = $this->deepClone($value);
                }
                unset($value);
            }
            return (object)$vars;
        }
        if (!is_array($vars)) {
            return $vars;
        }
        foreach ($vars as &$value) {
            if (is_array($value) || is_object($value)) {
                $value = $this->deepClone($value);
            }
            unset($value);
        }
        return $vars;
    }