Closed kocsismate closed 4 years ago
I made a patch to allow empty needles by explicitly checking in grapheme_strpos_utf16.
See https://github.com/php/php-src/compare/master...chschneider:grapheme_empty_needles for the diff, should I submit a pull request or are there major issues with this approach?
@chschneider Looks reasonable
Currently, string functions in ext/standard and ext/mbstring can accept an empty
$needle
, so we should add support for this in ext/intl as well.The relevant code that needs to be changed is https://github.com/unicode-org/icu/blob/f744742e036441cbfd54b535e722dc3801ff0f63/icu4c/source/i18n/usearch.cpp#L2675. Discussion: https://github.com/php/php-src/pull/5972#discussion_r481912754