Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127506 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 1C8271A00BC for ; Thu, 29 May 2025 23:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748561362; bh=bSSfFLdDVJZsIpX6aFTno49iHYLWP5XVkG44f+F1n8w=; h=Date:From:To:Subject:In-Reply-To:References:From; b=Wt4cjfoxnuB9SiqTMGFrmrty5lFju4WPRl6qomgcYOdUTaTW1RDiCjTUgsUglUsTU 57Ab0gcpdhfKRD24oaNxmjUo9QURs2qGMmYJuCCMA2ouReXFYat95VR2BOrWzGQJBr 4w4F55z5dk1I5HkikUbJvN+cLWptiMr0yD2BubMBTo6vMrDNXJ5V7P485iZ/6jy3QC TOCzoHDEcBbwXZMQ//yMrrDTaN8pXRoXPRgzAjVshjblpfP4PrWN/phz6bvhjtKkWs iFUpvu1jWqXiH0gaXfL8H+9uL8nIdhd+RbgwiqRKd6TvlgBd+0+swSUewbOWytWORw xFsyEuBDjky5Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8FAA318006C for ; Thu, 29 May 2025 23:29:21 +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=3.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_PASS, SPF_SOFTFAIL 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 xdebug.org (xdebug.org [82.113.146.227]) (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 ; Thu, 29 May 2025 23:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748561485; bh=bSSfFLdDVJZsIpX6aFTno49iHYLWP5XVkG44f+F1n8w=; h=Date:From:To:Subject:In-Reply-To:References:From; b=ToGYKULpu5JwKhAqIbR1kzeTAFISQHbgLyi1cEC1Pp2Zl5yq0V+dZCtf+xOTVTwhk xdpPq+XEZUtjioNUcjP15pjIopw5zh2GezGSL9f9qCa/2E3QM5oRE6bafMsSQzFnwa RFLviebtwe3HHAn9mDi4tKlZ1/rpsOZHDYlszVbReX/fEAcqdO4iyBb056T681vvxF D+T26WCFKNUrQKE70kQcpias2h7EuHffXTek1e+7I/e/yFGWAujZtuos3pluulPz2V MLOs+M7HQkjqd3UVggmLQxdu2O1twPUMnU5Pgcy71hlevAP1EI90s1Ag0gKQYEzZRP VmvID4j4s047A== Received: from [127.0.0.1] (unknown [148.252.141.95]) by xdebug.org (Postfix) with ESMTPSA id 5E97410C142; Fri, 30 May 2025 00:31:25 +0100 (BST) Date: Fri, 30 May 2025 00:31:22 +0100 To: internals@lists.php.net, Kamil Tekiela , Adam Cable Subject: Re: [PHP-DEV] Adding in a case-insensitive version of str_contains User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: derick@php.net (Derick Rethans) On 29 May 2025 22:00:00 BST, Kamil Tekiela wrote: >As I understand, it was a conscious decision not to add this function >when str_contains was created=2E The reason is that case sensitivity is >locale-dependent, and for such use cases, mbstring extension is better >[1] & [2]=2E Do you think that locale is a concern here, and if not, >why? Would it be a good idea to add mb_str_icontains instead? mbstring doesn't deal with, or handle, locales, only charactersets=2E So t= hat wouldn't be a good fit either=2E=20 There is grapheme_stripos, but that also doesn't do it locale dependent: <= https://www=2Ephp=2Enet/manual/en/function=2Egrapheme-stripos=2Ephp> PHP could really do with a locale aware, grapheme aware, set of Text utili= ties=2E=20 I have a prototype at where this s= uggested function also would fit in=2E=20 cheers=20 Derick=20