Hey Adam Am 01.07.25 um 09:01 schrieb Adam Cable:
Hi,Voting just opened on the "str_icontains" RFC.
I have also voted *no* on this RFC for 2 reasons.1. I also think that - if we go that route - the other convenience functions around strpos need to be taken into account here as well.
2. case-insensitivity isn't as easy as it looks. Even based on ASCII there are cases - depending on the used alphabet - where it's not as easy. And by using any of the already existing options for case-folding (strtolower, mb_strtolower, Transliterator::transliterate() to name a few) on the passed parameters the results are much more reliable and less confusing depending on the use-case.
To get an idea where stuff gets odd: Which one is the correct lower-case letter for "I" (U+0049)... Usually it's "i" (U+0069). Unless you are in turkey (or some other parts of that area) where it is "ı" (U+0131). Because the "i" (U+0069) is the lower case version of "İ" (U+0130)...
So by using explicit conversions of the input data before passing them to str_contains (or any of the other functions) we get a more predictable result than by using `str_icontains` which might or might not do what I expect...
Regards Andreas -- ,,, (o o) +---------------------------------------------------------ooO-(_)-Ooo-+ | Andreas Heigl | | mailto:andr...@heigl.org N 50°22'59.5" E 08°23'58" | | https://andreas.heigl.org | +---------------------------------------------------------------------+ | https://hei.gl/appointmentwithandreas | +---------------------------------------------------------------------+ | GPG-Key: https://hei.gl/keyandreasheiglorg | +---------------------------------------------------------------------+
OpenPGP_signature.asc
Description: OpenPGP digital signature