Re: Adding in a case-insensitive version of str_contains
| From: | Aleksander Machniak | Date: | Fri, 30 May 2025 06:20:52 +0000 |
| Subject: | Re: Adding in a case-insensitive version of str_contains | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127507@lists.php.net to get a copy of this message | ||
On 29.05.2025 23:00, Kamil Tekiela wrote:
As I understand, it was a conscious decision not to add this function when str_contains was created. The reason is that case sensitivity is locale-dependent, and for such use cases, mbstring extension is better [1] & [2]. Do you think that locale is a concern here, and if not, why? Would it be a good idea to add mb_str_icontains instead?stripos is not locale dependent, str_icontains should use the same case-folding rules and we're good and consistent. I'll vote Yes. -- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net] ---------------------------------------------------- PGP: 19359DC1 # Blog: https://kolabian.wordpress.com