Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127504 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 979351A00BC for ; Thu, 29 May 2025 20:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748550446; bh=NogL4B2dlxu4aFYWtZ6DxSWFKovkWk54CCfQOQZe9Kc=; h=From:Date:Subject:To:From; b=JXNMhLrr6yiBUkrWOm6gJ6vcHFMTt0gQSxFnnpl5QEk6z5LN6DbFgMS+N6ZZhzMVH dIGRaaepivZazsHPn21eHUligpRs2byWbC9zPioXPsgFcCIofffelT49Aao4g6Sj+k sp/96PbxA7p/FGFT2hejIXyc6mK/SvCnm09q7qJfHu0i6mNLKJjO2ByGey1R/5Rs7L Jn0YoqrHWByrYECWTqnRomkN7f8OIOdqp/dph5mJqYR/jIP0zMF/lYuecN/BB0rm1m UjJ9piDSmDrjlYWA9JClyH08jeepzonitfjRk5/s2WwfqXy2gdSp1ljktrHkJ9MjB3 JEDAvhXt3tXhg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BBE0D180074 for ; Thu, 29 May 2025 20:27:25 +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=-1.2 required=5.0 tests=BAYES_40,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-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 20:27:25 +0000 (UTC) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-6045e69c9a8so2286009a12.3 for ; Thu, 29 May 2025 13:29:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748550570; x=1749155370; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=NogL4B2dlxu4aFYWtZ6DxSWFKovkWk54CCfQOQZe9Kc=; b=QcYpvZGwjhGeOSU1BRlfCnPHWpoQeRUrO0tTUwNeFiZjg5D2IAo8M2aQvhmJuI6Nbg 3egEmvvMF5Ds5ey5DZMAlwNsGhUg4UM1YfqaQMAlfw5DPZlINHK1Ke5/0GH5K7v1wbmf hdc7H2AGmYJWVOV5DfXSBjHl0wkIEjMScZd03FNcepLFjP4PzfeX3HG1xBajdzWGypRS QHfSAO8LFfa7IDWK5+eBD8nmWDxtgEcaW2PYQ7xWQXVMD0IzRK0ss4QrHirnyAwCvkIE 7HifvTsS1k+DTGU4Xg5i0eu/qw/zxXrpGIuSTGDAdgAgGgtQYE2sDRopTS46vVKeiRbj xmhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748550570; x=1749155370; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=NogL4B2dlxu4aFYWtZ6DxSWFKovkWk54CCfQOQZe9Kc=; b=jbjDcTpCBvHh9wM2sDVot5rgi3Uqb6OQRU2SdhboF1rHmhHndztyNU3kry0v0Gwp5l idaZk0SN1XSJ1gUvsUFrBVe9sECl1uVJAJ6wgwokARKEYZSJvwqSY4Dm1BIeBKYqpk9f ZNlrj8T8Hn9H0lu9huT0y4knpCqPQHGkfS08pUD9+1CkOcUOJKV41eIKTukkV5NtsynP QbIIlemr1pJrokfiT/ZcfGd9ZO3iZmJI6bijcyy3znTDrfawAIFeFmAAYu4lQx9zFkzu TnRWsXUVmY28EoO2vbR54Exe0pRbDfWQ4rFG3OqOH6PBdbv8zkcipKk9wByipdogerSZ /iXw== X-Gm-Message-State: AOJu0Yxna92q8Cv8+B/kJNrb/vvbBluhOg+6IH4cJvj7ICk6to2NL59U 50oRYy0zHiIxBcQasVfLIpWdh4bB4jQLKY13ZHoHOiVPExTARcjdDx8uhRFVOfO31BTo0Whnd27 WFi790x8gkt03gxHpHhz6Yep3js2cXsjJMAzP X-Gm-Gg: ASbGncu3fTCVWdbPWoOLSdt4rgHLwtVMgT/kyMzNbzCZcatdXl7LmCdCf4MY5vLoK/D qCj0aZf9JpKL9lu3r0+ekTWRp9Og+wsf4YIX7WsUHtV6nX+S1JnSCKeekaYRM+Z/9G/GKLrYrfC mVX5MGv8ighbDEzDys5J4vzV5DYpODeiO0otBCQ5Re/JQ= X-Google-Smtp-Source: AGHT+IH2X051aC7+pb1Un0ClSq5MWuIvR5qR30B698wTQE5E3Igbp5v8vItUWytnMWYyZFf2kIGpUnb54y5oTG0bofI= X-Received: by 2002:a17:907:72d2:b0:adb:23e0:9290 with SMTP id a640c23a62f3a-adb3225d32dmr84871866b.4.1748550569979; Thu, 29 May 2025 13:29:29 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 29 May 2025 21:29:18 +0100 X-Gm-Features: AX0GCFvJpDRcOBbGxLXhgGv_npMle4XZoFjEOIXWiwnacjKfgq4Kttyk8MRi8Qw Message-ID: Subject: [PHP-DEV] Adding in a case-insensitive version of str_contains To: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000009873e606364c27f2" From: adamcable@gmail.com (Adam Cable) --0000000000009873e606364c27f2 Content-Type: text/plain; charset="UTF-8" As a PHP developer of 20 years I'm somewhat accustomed to adding "i" into the function name when I'm after a case-insensitive version. Therefore, I found it a bit odd I couldn't do it with the new "str_contains" function, so have built a basic ci version @ https://github.com/php/php-src/pull/18705 I appreciate that there may be a bit of negative reaction about adding such a basic function that can so easily be written in user-land. But for me, as an average PHP coder, I think it's useful to try and fill in gaps which can cause head-scratching. Thanks, Adam --0000000000009873e606364c27f2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As a PHP developer of 20 years I'm somewhat accustomed= to adding "i" into the function name when I'm after a case-i= nsensitive version.

Therefore, I found it a bit odd I couldn't d= o it with the new "str_contains" function, so have built a basic = ci version @ https://= github.com/php/php-src/pull/18705

I appreciate that there may be= a bit of negative reaction about adding such a basic function that can so = easily be written in user-land. But for me, as an average PHP coder, I thin= k it's useful to try and fill in gaps which can cause head-scratching.<= br>
Thanks,
Adam
--0000000000009873e606364c27f2--