Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94814 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8088 invoked from network); 3 Aug 2016 09:23:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2016 09:23:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.22 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.22 mout.gmx.net Received: from [212.227.17.22] ([212.227.17.22:51915] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/20-06291-728B1A75 for ; Wed, 03 Aug 2016 05:23:52 -0400 Received: from [192.168.2.103] ([217.82.227.154]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MWCKz-1bk1aJ3ydl-00XLnf; Wed, 03 Aug 2016 11:23:03 +0200 To: =?UTF-8?Q?Lauri_Kentt=c3=a4?= , will@wkhudgins.info References: <8442f1fa5544b2ca03e7cebbc64e8e5c@wkhudgins.info> <47b916a34bf50d43c71dc7c0aec61aca@k-piste.dy.fi> Cc: internals@lists.php.net Message-ID: Date: Wed, 3 Aug 2016 11:23:03 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <47b916a34bf50d43c71dc7c0aec61aca@k-piste.dy.fi> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:ate+BQ19gGFi98xcnS3myOQZrti4ofL5mg2Ox1lkEiwM5wvRnVy g9MBYG45LrNVDnC1XSUKR4KXe0WKnqBsHmqM9UGy//ELPPnj8y9WXP1zX1xmA7NnuiwJHtI U8QgdEKyRWtAxgIq0HcLclkQlY+ofYxTSPKXq0Y6IIjTMfeG2GIm7K8XZU+e6alVJhH0oAc vyyJOz4n0mWtysWBY19Lw== X-UI-Out-Filterresults: notjunk:1;V01:K0:JrsSGB5bgFo=:s2YwIQAxUiUWTE4sFpgtcm DBgRALcXH8jaq0n0kYEWlcEmGVXl8ip0kLoe4eC5I5h69IXgcETTVv8vwRH2dLqXMTnEpH8y+ cDtt2Z1w9ADcAdCxGXEzSxsL6Y15SSVeJRtfbmBbAFPShqSLz9BCEzGLICPXlNPKIpeoWbKE2 MfOarYJkAQDpOdt+1comkbKaK5QNlywg5y5Qux6MY03MKpqApeNWgKppzmwIJPQZPaPaacPMO 9WDOZi1v0fpyO8AzQPZsE+VN9VPSc4+k9ECENQ5Up/aGGVo76RwMLj45mn0z1F5utfNehY/z1 8TvvM8GLYOIM1yuGEjwAa6eXCoPaZDJUq7MN/cPZM+bTCi7/2di1JmukK4WiJIlw84J1TI8qQ B3HwTNtIpDZ6rZFiNUcpmIr4Gg92QbAxt3bR3LeAjmWvdVnlZDBF6iVezfjqkmYVIxE6/us9d ZztBAObn1xsAFGLZhQ2XowGXRK8l4Xab3cMx918B7iLzkAnWV40Cr2t12V6g9vy6WyikT0ybY TNliSFf0TSAyhha/ecK8AMXG0wUzaHURQbqteQz3S++8FzYhgYjNWFmOQPBXIf2PzdVU6tCmZ 2BlVCeWiOPKoVtt4n40AJe/B8elI987LxjllXVWf9hJ+FAzs6YCF7c+ObrxbZxPIWge//NZiH gK7xqGRg4jPdUsPHoX0AqEfRvtogclxMl1+s2OH4bqRn4tjI6iMfPzrdNl4fplYEwcuOpfIq1 0zKo/L60WG2UK282zMcP36VY90WJ40erSPy5bSRCOqsjKklEEkED7mFGcjjuQuOusPv6jqgC8 xBQOt+o Subject: Re: [PHP-DEV] RFC Posted for str_begins and str_ends functions From: cmbecker69@gmx.de (Christoph Becker) On 03.08.2016 at 09:59, Lauri Kenttä wrote: > I only saw you mention strpos, preg_match and substr as (slower) > alternatives. However, there's already a function called substr_compare > which is meant for just this kind of comparisons but which is more > general than your RFC. Thanks for pointing out substr_compare(), of which I even have not been aware of. And indeed, substr_compare() is perfectly suitable to verify whether a string starts or ends with a certain substring, so, in my opinion, there is no need for the other functions to be added to ext/standard. -- Christoph M. Becker