protected static function removeSegments(array &$array, $key)
    {
        $parts = self::explodeDotNotationKeys($key);

        while (count($parts) > 1) {
            $part = array_shift($parts);
            if (isset($array[$part]) && is_array($array[$part])) {
                $array =& $array[$part];
            }
        }
        unset($array[array_shift($parts)]);
    }