public static function compareAccept(string $accept, array $available)
    {
        $result = [];
        foreach (static::parseAccept($accept) as $type => $priority) {
            if (strpos($type, '*') === false) {
                if (in_array($type, $available)) {
                    $result[$type] = max($result[$type] ?? 0, $priority);
                }
            } else {
                foreach ($available as $available_type) {
                    if (fnmatch($type, $available_type)) {
                        $result[$available_type] = max(
                            $result[$available_type] ?? 0,
                            $priority
                        );
                    }
                }
            }
        }
        return $result;
    }