Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108647 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76853 invoked from network); 17 Feb 2020 13:54:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Feb 2020 13:54:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0A11D1804D9 for ; Mon, 17 Feb 2020 04:09:31 -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,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-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 ; Mon, 17 Feb 2020 04:09:30 -0800 (PST) Received: by mail-io1-f45.google.com with SMTP id h8so5748528iob.2 for ; Mon, 17 Feb 2020 04:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Xn9f91nkvIQ8kUZ578Qp7zedR5IT8OvLrh0qd+aDkFQ=; b=eg4YvhIc2uyiDQtqwr/eMVQdyCA4fq+pD96UpW5YSWUR/pmi1R4aHaiyNO1HAWSAgU SW6dPsT+0s9mqUJXtJM5ePnCof5xVvwHcSnBIP5gPicjZHa/11bxl2Hjti+RJqFqP7W1 c5fF60A7vsxK5tXpj/vVaAkvpYrMmlTjUkKp7D18xLP8Qs9rUA4zfS7axNMyITJd7F7v a4epEdzgXc7VWFCAFET8DgISbvNVEOK1iagRH54uBkTn6242xORgS0V7CIBd/dNoki+1 KDGnEfcHJXA0YddWDuogbVpgxNoY67jBYB0AnHbh32BluesLGoZ0D1SaaIn9r71t2xQu h1Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xn9f91nkvIQ8kUZ578Qp7zedR5IT8OvLrh0qd+aDkFQ=; b=Knhxx0AWBQZzFEskQMkeJtsUDvhY/ymI0u0dgSjL2V+pywVQ1RZgRi1RDJNkxG9odp t6QX+eqpoE6zh1wc+G72YLA0jW8zgp8NKk+tPoMas0p/RGrVdInhu+4q6tB9C8KcoYwG 36znxWj1enXbgXx0HX09Hw0PN43u+IAFRdupZYF+DhBrg0UCYKjjVPxRY1Smxj+R9f13 UJSu2rAT780rMr2PLB+u1+jVuiGwoxkTHCthrb+3Ioyy5Ci0Vkg92z7H0Aau+bt7A4nt qwgdq8qEUw8k4oz0lT+PndZHMaeZaRXbwxEijnppi2hO1vkRQ18VqW3NH+uA1OKyAkQS CsAA== X-Gm-Message-State: APjAAAWja1ba6WL07yGIBROB5KJ/y/g+pUQeMfs/ThONB3ReAmitkBmP MQedm8ts90B/csQJnwaprAcvsYzFmnvg3rO6mJM= X-Google-Smtp-Source: APXvYqxCL3bRydZZK6URBjNY8qVt4UP6DVlld34OPID/JL8+q0W4V2Amlm9CsFXY+s/Bevgz/JORj2YyLaDHlrATfIE= X-Received: by 2002:a5e:a616:: with SMTP id q22mr11708717ioi.250.1581941370046; Mon, 17 Feb 2020 04:09:30 -0800 (PST) MIME-Version: 1.0 References: <4a0f4d30-c8d3-0274-413f-0f4c582418d0@aegir.sexy> In-Reply-To: Date: Mon, 17 Feb 2020 13:08:54 +0100 Message-ID: To: Nikita Popov Cc: Benjamin Morel , Guilliam Xavier , "G. P. B." , Aegir Leet , "internals@lists.php.net" Content-Type: multipart/alternative; boundary="0000000000006ad01c059ec46dc0" Subject: Re: [PHP-DEV] Proposal for a new basic function: str_contains From: philipp.tanlak@gmail.com (Philipp Tanlak) --0000000000006ad01c059ec46dc0 Content-Type: text/plain; charset="UTF-8" Am Mo., 17. Feb. 2020 um 12:56 Uhr schrieb Nikita Popov < nikita.ppv@gmail.com>: > On Mon, Feb 17, 2020 at 12:49 PM Benjamin Morel > wrote: > >> Thanks for the karma! An RFC has been created: >>> https://wiki.php.net/rfc/str_contains >> >> >> >> Something that's missing from the RFC is the behaviour when $needle is an >> empty string: >> >> str_contains('abc', ''); >> str_contains('', ''); >> >> Will these always return false? >> > > As of PHP 8, behavior of '' in string search functions is well defined, > and we consider '' to occur at every position in the string, including one > past the end. As such, both of these will (or at least should) return true. > The empty string is contained in every string. > > Regards, > Nikita > Thanks for the hint Benjamin. I've cited Nikita and added that to the RFC for clarification. --0000000000006ad01c059ec46dc0--