The Grapheme polyfill is failing tests when using `\X` as regex for clusters
See CI jobs for PHP 7.3+ which are failing a test when using the polyfill:
$this->assertSame('☎', grapheme_substr('☢☎❄', 1, 1));
\X does not split those as separate grapheme clusters.
Apparently, the \X is correct only starting in PCRE 10.44: https://github.com/PCRE2Project/pcre2/issues/410
We might need to change our condition for the usage of the fallback regex.
Yeah, it's only fixed in PCRE 10.44 (I was the one who reported).
This is worked around in the proposed grapheme_str_split PR. I don't think there is a way to overcome this, apart from skipping the assertions on older PCRE2 versions.
We already have some code dealing with that in https://github.com/symfony/polyfill/blob/a5ae13211e892f1b1e955f9a22d29eb1f9581c1f/src/Intl/Grapheme/Grapheme.php#L14