Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130319 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 B30EC1A00BC for ; Sun, 15 Mar 2026 07:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1773559256; bh=Vx6z/UXp6OlzhGsJPzntJ0yn50g312p5tt8+oXAJy7E=; h=From:Date:Subject:To:From; b=PIG/F9p0BtFUCrS3Z4fGfpeJHhM5JVFkbBGv2fzekTIR2ge1VHXI6qcHJnAetar0U tPRhDoMj2dQW6aBwHSxDYdQZs7+vZ+y90zjKD7VZHZqinL4FMAFUwMgIseuyvkRSYD N7mwWWbmttCNW3ORNp83nPkjcyRItxCwnsgCrHPm/YSUsLEFxAmmSXZ7FVE023z17D PNtjmyBe8dzEjkAEUUwRk8u2K565EL5CEzGWCOvzO1g+JWevzmYcm7q5oggcS2xxh7 Grwr/L5DXvHKUrUiVif56GBDARPyAkYLmZkdzmvcXQhKcLbU2qfQqvW+1iyWwQKpF9 3FdTiiczm5pJA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6BECB180057 for ; Sun, 15 Mar 2026 07:20:55 +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.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FORGED_GMAIL_RCVD,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: No X-Envelope-From: Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 ; Sun, 15 Mar 2026 07:20:55 +0000 (UTC) Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-899fb2b94c1so47632296d6.3 for ; Sun, 15 Mar 2026 00:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773559249; cv=none; d=google.com; s=arc-20240605; b=YjrxP16/jqPAYY+ia5u3hVLOHhRmdvsam+NK7/7dBKuC0P8Nbav7ONC2do6qhD1BWs qJmR9mWfaNX6f0Uq3j0dyil/x/NMwDhD2kRiC+0bj5ZqiV6MUPtLeW7JfJD9y7aPAhIs +gBC5uShvNLbZ7M69oTujV9p7IevfMRAiKyORXGjL9UN0yWSftAYni1JnFuS4Ni/tUZP Cx56PDxFg1XmGwgkwCS3s02Kamk23jgMLLFiBWKdQ0TcqghSKtMw0QGr42CJmOtGU04n Skbf9P/vtnwtpuW6mRh+NxFAc/p7x11KnE8C1Gw+4i5aOXUz278ci258rxTwiRIjmBBG 3ZeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=Vx6z/UXp6OlzhGsJPzntJ0yn50g312p5tt8+oXAJy7E=; fh=PwvV1jWZOR90rDIG/6XexqaHJyAFBTdnFVhsS64qdEQ=; b=K35FHtCEbXqF2u/QS5ginwHQrhWFFcOHHJtKA7e1l3hBoBKDEFLc3w/AZHWqbtUCP5 rEev1xT9xch/DhDlGjUN/KfRWXCKyQsA+HZnW+tUQsJRaB1yro5vJKH8OG8p/DZPAcZA 37Ofw/a0g9P+XnitLP07HKRNz7EA0ayzFUdK64TNIhIRRf3uRmGjOTRdR/5qdW14y5iT U5Gd6CDlERMBBaOJCHC3EveqMogfejaRaCFOuOw4rftASWrev4WE1+CJSu4ImR8WkOwd KT29WaR9yStjVNfVAuJToiSJP2d2aZ/nYrMkC5fGraGud0OukTLPgzGFj9tax6XP5QlQ lH7w==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773559249; x=1774164049; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Vx6z/UXp6OlzhGsJPzntJ0yn50g312p5tt8+oXAJy7E=; b=YPTkVuKZv5QxGvKXcJMNHXNY4hVUPiSbXvbDZxOkFlwOFaUoT5XrwChKO/+RRAT7fb TmYa10ah6LSxKeDqmRD7S5L/5h0JJ0s7kIozq+wIBe5E9EQGsuTk9ep7zLHbH35kM6BE Dt/LZt4+JY27HsW0Iib+GG6h5ePffVWpyUd5hHC9zU4qQKWV28Aw6FHuEqTK9a5YS5vX LVWMKwhZZpHqQEx3tJhE9/MFxG/MSNQJATZtox3RfKW+KAjzSwPrT8I/7o55voWDAdkZ c9YFFvlKbezDsOSigCqTJEqLcz9MEFJzCizjvBu5sCrqbOTcIhyyIv3Z2htV9u1iv5jr 7zKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773559249; x=1774164049; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Vx6z/UXp6OlzhGsJPzntJ0yn50g312p5tt8+oXAJy7E=; b=gPrAju+pAeuouaL+6zcy9aUH3jsbHJ1/t0qGjFyE2x3x6TEczouvOdmfYGazH3WYC6 soQlfd0eezPAwwm6ppUH7ST5NLDou0vHuo/UF5rkSKft61On2YdnZlbGzjicS5qIHaIn Gq8HYDaDRqNZJKoX2W55Mg8/SxKAoIE156UkqNHbcVEtYcNUN2XtcctcsRBuGSwpjkA/ TqaGmg/OB2zLJRBUkmdlhRkxvasmig8gYPKMTuDNfTlY+GcryhZCYd0jRMex6+iti4U7 zBetp29FHs2431onjpqfMOg3cBmgtJ6tIV3QHCvFSyxWgolY+kbL/ylfrnyTm6QQWUIT 5MGQ== X-Gm-Message-State: AOJu0YxWM6i0TUbfia90hkQGHSD9PkAMQafW9JXuCkI+ARx2bIXM1FxO n7TIAqqfgGPxWyy3U+axTg6o0C5z/cSQr2alotEvGzF6VA8OOfYD6TVEhrfKXs7evOrUdw69Ry7 3luAnkWcDyS0geij7EzujRGTNdgTYQWkZWdIV X-Gm-Gg: ATEYQzyyw7DEdIdZap7IelaxL44sTjhADcP3gv7fRzLd8pouUY0O78pPvQ+LFoeHKl1 ablfwoBlOfzQPZRLQXwC4AXXDK1+k47zlTUg5IAGkL7OVEsEC9jArQCctDneF0olwh1PkXL/KaZ QZQhRen66biOfJXuli7gixKBn7Qgxf6c3nSYz0Wda8pVZhL5OFTdAyjKG17F4BlsnTkYXtkXSmY IF1G4AxK0f1DVels1R0J7+W6aG44JgmTWKZm9HD3yyvsgeo7P5uVRC3Z/xUsdVXe4sCh/F6MbiS DT7GnwurexohvKu1FmchndrQemBbbkNuNSjYfw== X-Received: by 2002:ad4:5741:0:b0:899:fd4a:64e2 with SMTP id 6a1803df08f44-89a81fe1ebemr135102446d6.46.1773559249306; Sun, 15 Mar 2026 00:20:49 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Sun, 15 Mar 2026 08:20:38 +0100 X-Gm-Features: AaiRm50c5yVtesKVhm8nLh8iqyzmg15xLEPAmaiNq4leXa9zYxHlXQX7j8lOQkE Message-ID: Subject: [PHP-DEV] Array arguments for str functions To: PHP internals Content-Type: multipart/alternative; boundary="0000000000000b086b064d0af195" From: barel.barelon@gmail.com (Barel) --0000000000000b086b064d0af195 Content-Type: text/plain; charset="UTF-8" Hi all, I would like to create an RFC proposal suggesting modifying the str_contains, str_starts_with and str_ends_with functions so that they can accept an array argument for the $needle parameter (apart from accepting a string as they do now). If an array is passed and the $haystack string contains, starts with or ends with any of the strings in the array then the functions will return true, otherwise returns false. I looked at the RFCs where these functions were added and at the related internal discussions and could not find any discussion about this possibility. Before creating the RFC I would like to hear the thoughts of the group, many thanks in advance Cheers Carlos --0000000000000b086b064d0af195 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

I would like to create an RFC proposal sugg= esting modifying the str_contains,=C2=A0str_starts_with and=C2=A0str_ends_with=C2=A0functions so that they can accept an a= rray argument for the $needle parameter (apart from accepting = a string as they do now). If an array is passed and the $haystack string contains, starts with or ends with any of the strings in the arr= ay then the functions will return=C2=A0true, otherwise returns false.
I looked at the RFCs where these functions were added and at the related = internal discussions and could not find any discussion about this possibili= ty.
Before creating the RFC I would like to hear the thoughts of the gro= up, many thanks in advance

Cheers

Carlos
--0000000000000b086b064d0af195--