public static function charCount($char): int
    {
        self::handleIncomingChar($char);
        $stringChar = (string) $char;

        return mb_ord($stringChar, mb_detect_encoding($stringChar)) > 0xFFFF ? 2 : 1;
    }
public static function charCount($char): int
    {
        self::handleIncomingChar($char);
        $stringChar = (string) $char;

        return mb_ord($stringChar, mb_detect_encoding($stringChar)) > 0xFFFF ? 2 : 1;
    }
public static function charCount ( $ char ) : int { self :: handleIncomingChar ( $ char ) ; $ stringChar = ( string ) $ char ; return mb_ord ( $ stringChar , mb_detect_encoding ( $ stringChar ) ) > 0xFFFF ? 2 : 1 ; }
Determines the number of char values needed to represent the specified character

@param static|string $char
@return int
@throws InvalidArgumentException
@throws TypeError
Determines the number of char values needed to represent the specified character