Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127742 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id C70D91A00BC for ; Tue, 24 Jun 2025 08:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750752680; bh=FMVHpiiQWR4izmtfNT0Z/eZ2UpclrLjT/b5oEEFis6c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oQt769t9a4V1Dp2pCz2LCkFYqUPpK7QYHyWAjP2qQI2ybxLrzc1smYonc1U/AhL2R 9JVTl+edTfgMhvOpFJ9mHOSngUIaqHcPbDO+c9JCbTmVeoXeh6JltQscJPKva1TOq7 hU/Ajeol4kmT/UN23jLgGTCr3V06mOVZL+04nFJRq2ji/EijTH5X3yUXvxxh634b7P cZaiqyq7tBQX9jCmcBALx9BbyfCjAjsz0jK0uUQJYYbRGWZJyA+nJLTqqmHJA55FuJ EO6r7daOcl5sGBaDbS9TICQz053vqRLx0Ude4rjSbd+Ie2IRLlSfVCqooNaxuaf+X3 7cB1oHNMBgJKg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D60251801D7 for ; Tue, 24 Jun 2025 08:11:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 24 Jun 2025 08:11:19 +0000 (UTC) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-adb2bb25105so808746266b.0 for ; Tue, 24 Jun 2025 01:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750752794; x=1751357594; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=k2BsdUlZENXJUtzBlydGRWVb+wqd5uZubMytQFOwAVg=; b=FShONSFr9X8sfRKVJ+dncjkmOYUj7H7mMkpINm6/1oxIMZAVQqHafVELXJ+0xEHLrR 1X740uL9FJVr11ALElzd8rhbKERBlHssEJPI/LeC6PsBkS7tk2asXySzt2LPaCFOdndm bo+Ff7+y3oC+L6doSFzuldIhS//L2Eavnvd2Cd5qhf6T5mISvuQaFY5WcYczo0EaNQ0m l/doVx+KXpEZA99R62nNnCI3rH8yqKiywTvLMF2/qcI082bD7i2Pnpe4h7IKfEZ84ZNZ wHOSy7sVRSdmJXqFbPDorEv1KhEBby9FATPuB3SWsEvr87vOykiNsW9X0z/hJj1Qc8gn +Rbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750752794; x=1751357594; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=k2BsdUlZENXJUtzBlydGRWVb+wqd5uZubMytQFOwAVg=; b=S2WhKhQBZx7DBiPO8LpD9VGFQgel1VywBEzxo+ggn04CqzIsrCq/ilRWwVWlUplcyR z3f1RbgIJz+0k8Gw0umgpOhSv3m6Zg7ZDVbr7O1CuNwa2saFIea6RnD4mRze9dxvm77e pWSvQAjyCY95ghacESNKL7fub8J0ovBk+tbrn0HZCnugxf0KPw5BfonmIXPG+G+KEWd5 60Bqs3TBspWZX0iquPKR3vFWcfWDhXdS0Utj7WLiZ26J6kxpd2yj1pjp6pFrO044xoAD zFueX08S143ZxOra1t94uMg7LjU4BnUrdT9qZ01cPxGRuks+hByRGC1zE/8Un2qzoNPC IkIQ== X-Gm-Message-State: AOJu0YwxsyXD7h8WTYWfakkcHazstoqIBkUKkf5IAEQBERAIJYy6Dq4U IIY8dY8XGqCSl4vPJM9PzYZIlhnoNjN29aGUAq+a7gG4qPljHO86qCKCN0goHbgX63iU66hEosh 8cY1gAHwrP2Fhg9RuaUGci0sOcZ+9+apaaA== X-Gm-Gg: ASbGnctVmMkJgUIhZGhpsz43m44lGrUN5W3zAPoU02+47/xrdCq8TTsVMBL+B7xacVY teLX758PcaVAeTAzeCnd8a2aLJhyBR8ECFP/Jb8MHaomTLZtJpizh2JsNrubRy7MJ/qFYvJ21t4 coaRz04C5BgWIu/BN3dRUlTGOp8t9wWK9asFjjaZcbVkU= X-Google-Smtp-Source: AGHT+IFWtyi2wLYrKo1HOPDy31M71i3MtWnVVbBsb+S09kMwrTEN0ifi/BQP72TS1sh9FdrhSKkauZHQ42UcXa7XAZc= X-Received: by 2002:a17:907:7250:b0:add:fa4e:8a5d with SMTP id a640c23a62f3a-ae057b68ecamr1573960566b.32.1750752793754; Tue, 24 Jun 2025 01:13:13 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <69ee9492-f7eb-4287-b222-41682ee41879@app.fastmail.com> In-Reply-To: Date: Tue, 24 Jun 2025 09:12:59 +0100 X-Gm-Features: Ac12FXyCag2OEhkWbSntLPgc2vT4rro4LzVZhQTnFXCK2eA1zdPjXZhwQ5xeCJs Message-ID: Subject: Re: [PHP-DEV] [RFC] str_icontains To: youkidearitai Cc: php internals Content-Type: multipart/alternative; boundary="0000000000005c814406384ce64c" From: adamcable@gmail.com (Adam Cable) --0000000000005c814406384ce64c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 24, 2025 at 1:56=E2=80=AFAM youkidearitai wrote: > 2025=E5=B9=B46=E6=9C=8824=E6=97=A5(=E7=81=AB) 9:00 Larry Garfield : > > > > On Sun, Jun 15, 2025, at 3:12 PM, Adam Cable wrote: > > > Hello internals, > > > > > > I'd like to present my first RFC - str_icontains, a case-insensitive > > > friend of str_contains > > > > > > RFC: https://wiki.php.net/rfc/str_icontains > > > PR (including tests): https://github.com/php/php-src/pull/18705 > > > > > > Previous discussion: https://externals.io/message/127504 > > > > > > Thanks, > > > Adam > > > > When str_contains() was added, a case-insensitive version was > deliberately omitted in favor of "just use strtolower() yourself." Have > you gone back to see the arguments for that to determine if they're still > relevant? > > > > (I don't recall the details; I think one of them was function count > explosion, but I think there were more.) > > > > --Larry Garfield > > Hi > I have concerns from multibyte(Unicode) user. > > As someone who relies on Unicode, I feel that it is not worth using > that function. > str_contains can matches binary, so this is benefit of many reason, > but str_icontains is only support ASCII. > This only benefits some regions. > > Regards > Yuya > > -- > --------------------------- > Yuya Hamada (tekimen) > - https://tekitoh-memdhoi.info > - https://github.com/youkidearitai > ----------------------------- > Hi Yuya, Thanks for your message. I totally appreciate the multibyte issue here. I've detailed about it in the RFC. This function is there just to help those that expect it to be available as parity to strpos, strstr that have ASCII case-folding case-insensitive versions available. Thanks, Adam --0000000000005c814406384ce64c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Jun 24,= 2025 at 1:56=E2=80=AFAM youkidearitai <youkidearitai@gmail.com> wrote:
2025=E5=B9=B46=E6=9C=8824=E6=97=A5(=E7=81= =AB) 9:00 Larry Garfield <larry@garfieldtech.com>:
>
> On Sun, Jun 15, 2025, at 3:12 PM, Adam Cable wrote:
> > Hello internals,
> >
> > I'd like to present my first RFC - str_icontains, a case-inse= nsitive
> > friend of str_contains
> >
> > RFC: https://wiki.php.net/rfc/str_icontains
> > PR (including tests): https://github.com/php/php-= src/pull/18705
> >
> > Previous discussion: https://externals.io/message/12750= 4
> >
> > Thanks,
> > Adam
>
> When str_contains() was added, a case-insensitive version was delibera= tely omitted in favor of "just use strtolower() yourself."=C2=A0 = Have you gone back to see the arguments for that to determine if they'r= e still relevant?
>
> (I don't recall the details; I think one of them was function coun= t explosion, but I think there were more.)
>
> --Larry Garfield

Hi
I have concerns from multibyte(Unicode) user.

As someone who relies on Unicode, I feel that it is not worth using
that function.
str_contains can matches binary, so this is benefit of many reason,
but str_icontains is only support ASCII.
This only benefits some regions.

Regards
Yuya

--
---------------------------
Yuya Hamada (tekimen)
- https://tekitoh-memdhoi.info
- https://github.com/youkidearitai
-----------------------------


Hi Yuya,

Thanks for your message.
= I totally appreciate the multibyte issue here. I've detailed about it i= n the RFC.
This function is there just to help those that expect = it to be available as parity to strpos, strstr that have ASCII case-folding= case-insensitive versions available.

Thanks,
Adam
=C2=A0
--0000000000005c814406384ce64c--