protected function deep_clone($value) {
        if (is_object($value)) {
            // Objects must be cloned to begin with.
            $value = clone $value;
        }
        if (is_array($value) || is_object($value)) {
            foreach ($value as $key => $subvalue) {
                $value[$key] = $this->deep_clone($subvalue);
            }
        }
        return $value;
    }
protected function deep_clone($value) {
        if (is_object($value)) {
            // Objects must be cloned to begin with.
            $value = clone $value;
        }
        if (is_array($value) || is_object($value)) {
            foreach ($value as $key => $subvalue) {
                $value[$key] = $this->deep_clone($subvalue);
            }
        }
        return $value;
    }
protected function deep_clone ( $ value ) { if ( is_object ( $ value ) ) { // Objects must be cloned to begin with. $ value = clone $ value ; } if ( is_array ( $ value ) || is_object ( $ value ) ) { foreach ( $ value as $ key => $ subvalue ) { $ value [ $ key ] = $ this -> deep_clone ( $ subvalue ) ; } } return $ value ; }
Creates a reference free clone of the given value.

@param mixed $value
@return mixed
Creates a reference free clone of the given value .