Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127813 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 86E3B1A00BC for ; Tue, 1 Jul 2025 08:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751357734; bh=x+n/VKEO2WxcRiHpXzwJ9kg/a9swNbbs9MkSFc8f0eQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mAzYd3GsZek6Pkp0nhfMlrDVgSb+KqXcxyXBs8+eb7i65Es7Omu9Sce7nWiso5AGP 3f1AfyV8VnbEbmTmxXDKzko/c4NFNWADTSTTkPPvajOQ+n/Kixxeb0x8tBixlCaDgR R25Zv5Vo5zacCblFfZEHS6ipGeAwG58NlNQAXLAPZcxvsEVF19AuFtyUJxEK7ZmmHQ QyTCFVqZjpuvJSXTJBelrTQzk/QUNdqdhRUNqm28O98SaN7GXAo9OdPZASnM18lfxp ffm9qf8Oq44NNSTcj/nY9jhRE6lz++67HOrbAHoHoDtBzQe0BI5No75mty1WJewd/z Z1aR2siMx505w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 585E11801D4 for ; Tue, 1 Jul 2025 08:15:33 +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-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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, 1 Jul 2025 08:15:33 +0000 (UTC) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-60702d77c60so10782824a12.3 for ; Tue, 01 Jul 2025 01:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751357845; x=1751962645; 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=x+n/VKEO2WxcRiHpXzwJ9kg/a9swNbbs9MkSFc8f0eQ=; b=Qz43gU7RbEmeiwJ0UrvTmgjSmXivpEkFUC0GPunT6+HbpKma3HdXlgDc+OXlYL4wep lbgSc65DHHcRu67gCyC7mfueXwf/QnlbNf2GH1aNRd44btj0dCYMY8fWymKA61ThbjHT ksTrmy9nP8v5xxmTEJUqXdH4AfD99Mwu1Os8Jflj3V8CYh1T13nPwWoH55QJ53ZHNzUB sKctGdCPeVDFjCMHEySq1VLdxsN+KoceuOVEZ8U4dXBPGTEfpypGxcA2BMIEAEsTQiZo oQXpHjPBLd4g7sF+iQ+J9Tpm+D6pClOlKoArNISHbghHOl6vqkAif0XKAc1aljeTShjC 2hgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751357845; x=1751962645; 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=x+n/VKEO2WxcRiHpXzwJ9kg/a9swNbbs9MkSFc8f0eQ=; b=lXfoMfBnxS0G+9WDThnLtnXRXDekcfOV0ogThs1kJxYDfdTN7DzAZllSKmZdXnNGgN 2mnCOkHBXBdrUEBpF3ohBGTGtHo1uXx6MoUmOariGZ6APpUAHZyTSSlQaIvLzBZckoR4 9xi5J4gBOEpApM+fNWty16RwnsDdxiKwOFdOXaJ/KPE+34FW9p5MeSrNJcs3mUGiPdB4 bLwjyl3O5KX4ScMUGhmoNdwIr9bVT/T+47rz64hw4xmeWBAVtRaOQeETQMLb5oI1C/96 FqtrYAV7cgpcn3o9z5WS5cG4/TywqLsy/ZgA/CQHf1unOYchyqgX1rHZL/Ho1YnfwENg ol2w== X-Gm-Message-State: AOJu0YyyPWVtl63k+DSdzRdL/O4uWEaMLDQslHodAWxbeQveAuO2qaCJ I18pUbJUHz6OFGuS6+KTrPSHpH7RdehHml1rks6nQm62lBz9PTeGmJAcpq4ZcDwlraiExIdVLaf 3czalB1kkPR8DRqmUw6A/cUYMCGwu/kgQqmFC X-Gm-Gg: ASbGncs4nym8WhK5+0U7i5oJIBRAvxCoAsB4fPgtDgpUqMrD+QERKsfHaWWqWQ5cr/6 4UTreaRrT2LBVT4KLZaTs4fXzH93csfKKf8yEccmrjqYNYsN6BvArIb4gt0bb+VScUnlUtIR+2o nBuLbNXAlVxlwJcjjEp9jQ04M/f41NYQJhAczPRgxYReU= X-Google-Smtp-Source: AGHT+IFdM6UrEkk2DuFuOUHHXMIykV6KuE9rVHo4Zv8pLLb+zzWWQhrQx7h1yHPy7D/ZHGBAD4npBYXZL83MtYPje1I= X-Received: by 2002:a17:907:9809:b0:ae0:ad5c:4185 with SMTP id a640c23a62f3a-ae3501ef0c5mr1675240866b.57.1751357844682; Tue, 01 Jul 2025 01:17:24 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <0e13771dc08c4a7d880c1fff46d21bf0@bastelstu.be> In-Reply-To: <0e13771dc08c4a7d880c1fff46d21bf0@bastelstu.be> Date: Tue, 1 Jul 2025 09:17:12 +0100 X-Gm-Features: Ac12FXyUJ4npqKtZRK5yzWSR3MxUJxl1aptZW732FqHLKd66jJ23BJckmjk3OHI Message-ID: Subject: Re: [PHP-DEV] [VOTE] str_icontains To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: php internals Content-Type: multipart/alternative; boundary="00000000000034fa4c0638d9c6c7" From: adamcable@gmail.com (Adam Cable) --00000000000034fa4c0638d9c6c7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 1, 2025 at 8:24=E2=80=AFAM Tim D=C3=BCsterhus 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 =E2=80=9Cseems easy enough= =E2=80=9D 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=C3=BCsterhus > 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 --00000000000034fa4c0638d9c6c7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Jul 1, = 2025 at 8:24=E2=80=AFAM Tim D=C3=BCsterhus <tim@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 =E2=80=9Cseems easy enough= =E2=80=9D 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=C3=BCsterhus

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 th= an 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&q= uot;

Thanks,
Adam=C2=A0
--00000000000034fa4c0638d9c6c7--