Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127744 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 7F19F1A00BC for ; Tue, 24 Jun 2025 13:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750770704; bh=hiL97jTMN197PaAV3CY9I76+HKXov4fnk1xzHeG/Yt0=; h=Date:From:To:In-Reply-To:References:Subject:From; b=Y7t2t2QYKLKftyThOAa6enTNz6xPnB2uovkGXmeGyaNg6Q7oSP/KXj4pnZfNG2m41 3iFM6ji4Auw5zwDwOooHiXy5b/cllOPjLEzYVqY5UfXyDJkZLsHO/AP6vAK1eb9J6i keI3kGYdV1cDHqFNK75B9zCLNG89jIYLgBizRRTyJv0roBWwo9jWCtaaTPoWTX+qcs SuN44xcBbzMhQLwWETk4lK2OspeXU3R/k1cDe7xmteSk94vrwyrRvK4S8pU6uUZnhm 82L1kuEqWk8Jf5Hns2lM3DtjdOM1Epf7GJ86aEoI0O/kyesd9PR1Z0bz+CaftS/Fdt uKrzxq7KSRo2w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B45AD180041 for ; Tue, 24 Jun 2025 13:11:42 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE 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 fout-a1-smtp.messagingengine.com (fout-a1-smtp.messagingengine.com [103.168.172.144]) (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 13:11:42 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id E74AF1380CDF for ; Tue, 24 Jun 2025 09:13:37 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Tue, 24 Jun 2025 09:13:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm1; t=1750770817; x=1750857217; bh=rzn+SGmK14YCDDmsXkp6x 9Q9EPSnZ+HSOBm2Mc7LkK4=; b=NRxvhuyh0L1u1BMJOCG2tNyJ7sdLabHQgLjuI id6z5JNv/lW3GGD3iqgxonxo9aWZk18Ab0cnOotuFVLgVUmHdYgYuR7cKZystZoV DYKemAmu5vPnqOf2c+Dqhsr6zie+w+uU1D1zO7acRviA9ubyai2SOhVRz3fkE9F4 SWB6VrDv7YmrAwn8aM9zHOnvOX/AlVaXX7pJNDIvqa5eB1PwcaTx6FSuK/1mgn3i cgdYtjqyPEz/ptmfAgYzImpq+gZD3kHoe/Em0OEbPncQVxaFXAt5j3aTAZE42El6 SEWV6nSGUIwH/RHoR3l6a1RtP718M0GcNTiZY0KNTAGwX2N1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1750770817; x=1750857217; bh=r zn+SGmK14YCDDmsXkp6x9Q9EPSnZ+HSOBm2Mc7LkK4=; b=Y5oESXwTdPkER36CG wGmX4J0bqEx/az+ZE7ApHVMd/nN87SNu1+AyVo+waSWFXOGH74ZwQzvpgKMrMVCi 55+HhDvTCrECyfN1/u9yJh3JP9qhgkynNlmzN2YtMGq6MJyeNMh9tqdnlW+dM3Sy JJozw+dL0cyNnpsdtva0Ohw098JIVD3npqU7E1TA9cnq1Sir69nRJ/o4zXLnzk+r XPVrCbFhpC4NMuNW5KM/9H7tLr9S7QM4gClFvO39dmIlcLTj+rkLuuvkz37GOJx9 MOCzGx8BKaagwBkbw27qK9ZQgHT71602+hAMcIQWFkcVjupHt0RVpO6FKNRqtlrQ rZHOQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdduleelkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvkfgjfhfutgfgsehtqhertdertdejnecuhfhrohhmpedfnfgrrhhrhicu ifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqne cuggftrfgrthhtvghrnhepudfghffgudfffedvjeevtdfhudffieetfefhtdekvdejgfeg vdeliefhtdefhfehnecuffhomhgrihhnpehphhhprdhnvghtpdhgihhthhhusgdrtghomh dpvgigthgvrhhnrghlshdrihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsg gprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghr nhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 346AF700065; Tue, 24 Jun 2025 09:13:37 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: Ta0f257222eeff7bb Date: Tue, 24 Jun 2025 08:13:16 -0500 To: "php internals" Message-ID: <6da22e12-3db2-4880-b045-6eaf68f2a24a@app.fastmail.com> In-Reply-To: References: <69ee9492-f7eb-4287-b222-41682ee41879@app.fastmail.com> Subject: Re: [PHP-DEV] [RFC] str_icontains Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Tue, Jun 24, 2025, at 3:18 AM, Adam Cable wrote: > On Tue, Jun 24, 2025 at 12:20=E2=80=AFAM Larry Garfield wrote: >> 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-insensitiv= e=20 >> > 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 >>=20 >> When str_contains() was added, a case-insensitive version was deliber= ately omitted in favor of "just use strtolower() yourself." Have you go= ne back to see the arguments for that to determine if they're still rele= vant? >>=20 >> (I don't recall the details; I think one of them was function count e= xplosion, but I think there were more.) >>=20 >> --Larry Garfield > > Thanks Larry. > > Yes, I did spend time reading through the past discussions on both=20 > str_contains and the str_starts/end_with functions. > I think initial RFCs failed because (a) people felt that the functions=20 > didn't necessarily bring a whole heap of functionality above userland=20 > code and (b) the debate about whether case-insensitive versions should=20 > be included. > > Now that these functions exist, it seems weird as a PHP user that=20 > case-insensitive versions aren't available to easily switch between. > Obviously we have the UTF-8 question that I've detailed, but I'm hopin= g=20 > adding this will solve a tiny issue where people expect this function=20 > to exist, but it doesn't. > > Adam A discussion of that, and why you think the new position outweighs the o= riginal decision, should be included in the RFC. (At the moment I'm undecided; yeah it's an easy enough utility to add, b= ut the UTF-8 issue is real, and one could easily argue that it's stripos= () that's wrong, because it's misleading as it only works on ASCII.) The ideal answer would be Derick's built-in String object RFC, which I d= on't think has been touched in a while, sadly... --Larry Garfield