public static function findPrefix($first, ...$strings): string
    {
        if (\is_array($first)) {
            $strings = $first;
            $first = $strings[0];
            unset($strings[0]);
        }

        for ($i = 0, $n = \strlen($first); $i < $n; $i++) {
            foreach ($strings as $s) {
                if (!isset($s[$i]) || $first[$i] !== $s[$i]) {
                    while ($i && $first[$i - 1] >= "\x80" && $first[$i] >= "\x80" && $first[$i] < "\xC0") {
                        $i--;
                    }

                    return \substr($first, 0, $i);
                }
            }
        }

        return $first;
    }