public static function delete($key, &$array = null)
    {
        $segments = self::splitArrayPath($key);
        $key = array_pop($segments);
        $parentArrayKey = count($segments) ? implode('.', $segments) : null;
        $parentArray = &self::getRef($parentArrayKey, $array);
        
        if ($parentArray === null || !self::arrayHasKey($key, $parentArray)) {
            throw new AtomikException("Key '$key' does not exists");
        }
        
        $value = $parentArray[$key];
        unset($parentArray[$key]);
        return $value;
    }