Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108562 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91821 invoked from network); 14 Feb 2020 11:03:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Feb 2020 11:03:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ADE691804D1 for ; Fri, 14 Feb 2020 01:18:20 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 14 Feb 2020 01:18:20 -0800 (PST) Received: by mail-il1-f174.google.com with SMTP id p8so7472124iln.12 for ; Fri, 14 Feb 2020 01:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=XXVKOpUvHoHUKC3GINmRQf6qbDf3pN2ZgH1H8h/Xcgg=; b=R5EmDNXiYLFo6ZW1T+pK4uRZeapn45UGJIqEoF7/gfdobNtbIltoYT6uCi1wuZW18o cZ/jx+8c6Kl3gqz9eqMcDjf+xhwZ7u73/uaV7MMTuFXyqbaFgo5qsG+GFlPB2aFrQWBo 0+tcNyQ8rzFv9DIc5CR46UPdx9oE5vORjpTPmEYXATZBpHT3+++XL0q/gAM2OAbLUyvb W0JZ2TOEuLC5Oylp32hKmk0axrLR5SlhS6fZTDS0IuoVFkxYyGBTbmrGQn8Kl1qvpopO rAuSBMhN6pQb3CQYfKUCaPwEb3QyHxZk+kZ4cR7Zkdnv2Pl5eKMQeVsVIw/Do1TJd1F3 IOJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=XXVKOpUvHoHUKC3GINmRQf6qbDf3pN2ZgH1H8h/Xcgg=; b=OSOIAUkb/Vh/hIscyctoDhJCLqlGDSINomcxQo+WG3/VOAZ3cXko4PMH/v4pTdAFUS eky9lLyP7fUxK+FjEcW+6VDjeqLHmPvqL/L2BhKAZjy9YK4FIDGr/WK5EF1xYfAomU+d TpJTjcMhSQi2AsKYF1V1GbIcjci7B4UlnTgQblvuC9eJy4+5JNYCfvatgcsFT6MosAJE afY+tnqEs2fLTlAxeiQSsKuZ9QZ3SK4c3uAIYSCSPDLUrnkORfmUE7vdXQLKTj/wptXA 4tgVQPQMpp582ejrF2nVNiypzeHJvCeTLn+dTxQRWX4nUv69BQBqu6ji8+AU4M1fGE3u QgHw== X-Gm-Message-State: APjAAAXsSVR3W8MjbbGsQf7W32tA4eH9xwmly/gK90GE/p7aLTn7Vsu4 sDerIyLy6bLZgWJaxoPoyVbt8GnASH0kktICW0sKSdBk X-Google-Smtp-Source: APXvYqytEVLznK0rsPRwvuOyrxNIQzreSiX751BNkNx1ROhVgTElIvW1I3M031KxuGUfowEBBTPgq4D77sozGvkUxFk= X-Received: by 2002:a92:8808:: with SMTP id h8mr1831680ild.253.1581671897436; Fri, 14 Feb 2020 01:18:17 -0800 (PST) MIME-Version: 1.0 Date: Fri, 14 Feb 2020 10:17:40 +0100 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000009917d8059e85af74" Subject: Proposal for a new basic function: str_contains From: philipp.tanlak@gmail.com (Philipp Tanlak) --0000000000009917d8059e85af74 Content-Type: text/plain; charset="UTF-8" Hello PHP Devs, I would like to propose the new basic function: str_contains. The goal of this proposal is to standardize on a function, to check weather or not a string is contained in another string, which has a very common use-case in almost every PHP project. PHP Frameworks like Laravel create helper functions for this behavior because it is so ubiquitous. There are currently a couple of approaches to create such a behavior, most commonly: