Re: [VOTE] str_icontains
| From: | Tim Düsterhus | Date: | Tue, 01 Jul 2025 07:24:26 +0000 |
| Subject: | Re: [VOTE] str_icontains | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127811@lists.php.net to get a copy of this message | ||
Hi
Am 2025-07-01 09:01, schrieb Adam Cable:
Voting just opened on the "str_icontains" RFC. Please find the following resources: RFC: https://wiki.php.net/rfc/str_icontains Discussion: https://externals.io/message/127667 PR: https://github.com/php/php-src/pull/18705Thank you for your RFC. While I initially said “seems easy enough” in the PR and I also believe that making the function ASCII-only for consistency, I ultimately decided to vote against the RFC. My main reason is that I do not like how this function is added in a standalone fashion without a bigger picture. As mentioned in the PR,
str_starts_with() and str_ends_with() are obvious companion functions.
And ultimately calling strtolower() on both parameters before passing them to str_contains() is quite explicit in what it does (and would also resolve the Unicode vs ASCII confusion that others expressed). Alternatively stripos() would also work.
Best regards
Tim Düsterhus