public static function createFromHex($hexString): ?GUID
    {
        $hexString = str_replace(static::$searchChars, static::$replaceChars, $hexString);
        if (!preg_match('/^[0-9A-Fa-f]{32}$/', $hexString)) {
            return null;
        }

        $bin = pack('H*', $hexString);
        if (!static::validate($bin)) {
            return null;
        }

        return new static($bin);
    }
public static function createFromHex($hexString): ?GUID
    {
        $hexString = str_replace(static::$searchChars, static::$replaceChars, $hexString);
        if (!preg_match('/^[0-9A-Fa-f]{32}$/', $hexString)) {
            return null;
        }

        $bin = pack('H*', $hexString);
        if (!static::validate($bin)) {
            return null;
        }

        return new static($bin);
    }
public static function createFromHex ( $ hexString ) : ? GUID { $ hexString = str_replace ( static :: $ searchChars , static :: $ replaceChars , $ hexString ) ; if ( ! preg_match ( '/^[0-9A-Fa-f]{32}$/' , $ hexString ) ) { return null ; } $ bin = pack ( 'H*' , $ hexString ) ; if ( ! static :: validate ( $ bin ) ) { return null ; } return new static ( $ bin ) ; }
Creates a GUID object from a "hex string"

This accepts a strings such as "{9a39ed24-1752-4459-9ac2-6b0e8f0dcec7}" and generates a GUID object.
Note that this validates the input string and if validation fails it will return null.

@param string $hexString

@return GUID|null
Creates a GUID object from a hex string