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;
    }
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;
    }
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 ; }
Clones a variable in depth
@param $vars
@return mixed
Clones a variable in depth