On Tue, Jul 1, 2025 at 8:24 AM Tim Düsterhus <t...@bastelstu.be> wrote:

> 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/18705
>
> Thank 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
>

Hi Tim,

Thanks for giving an explanation of your vote, thank you.
I had assumed that going with a small RFC for this would be easier than
trying to get str_starts/ends_with through at the same time, as noted in
the PR:

"I'll create a RFC for this, and if successful look to do the same with
str_starts_with and str_ends_with"

Thanks,
Adam

Reply via email to