public static function isUtf8String(string $string): bool
    {
        // Keep calm. Just `mb_check_encoding($string, 'UTF-8')` sucks
        // PCRE `/u` is about 10 times faster.
        // https://3v4l.org/XYQ2A

        if (false !== \preg_match('/\\G/u', $string)) {
            return true;
        }
        if (\PREG_BAD_UTF8_ERROR === \preg_last_error()) {
            return false;
        }
        throw new \LogicException('Another unexpected failure happened with PCRE');
    }