public function remove($key)
    {
        $array = &$this->array;

        if (is_null($key)) {
            return $array;
        }

        $keys = explode('.', $this->escapedDotKeyToUnderscore($key));

        while (count($keys) > 1) {
            $key = $this->underscoreDotKeyToDot(array_shift($keys));

            if (isset($array[$key]) === false || is_array($array[$key]) === false) {
                $array[$key] = [];
            }

            $array = &$array[$key];
        }

        unset($array[$this->underscoreDotKeyToDot(array_shift($keys))]);

        return $this->array;
    }