Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106170 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26936 invoked from network); 8 Jul 2019 16:01:26 -0000 Received: from unknown (HELO mout.gmx.net) (212.227.17.22) by pb1.pair.com with SMTP; 8 Jul 2019 16:01:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1562592049; bh=pGxUdyfgrgzmCW+OKre9hZ6dN5vCNwK0FXb4yv2uyLk=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=h/PZ5S8JXGCjNcsZtPCpL0cx1X8XwDsyFjcScX+PlaxH6btDVajvT1R3KuU5Urjan /NNmF5dTruIWC4JdrH9MS/vanqSuqakMT2QK+suBI7YoQDUxRbkPfChgVxosq1kaF7 fIedH43gBn6lDL7v6IQXVKYz+8XoYhZ6Hl8z0dgE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.144] ([84.179.231.50]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MCwbX-1hasmh3idP-009jfg; Mon, 08 Jul 2019 15:20:48 +0200 To: Andrew Gromov , internals , ocramius@gmail.com References: <1562591120.659818.23020.47476@mail.rambler.ru> Message-ID: <7ff385f1-b86d-e56d-4133-e2f101afa13e@gmx.de> Date: Mon, 8 Jul 2019 15:20:48 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1562591120.659818.23020.47476@mail.rambler.ru> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:CyCSC0ZwXXCisouyFwOX1XRLuuhMhGyJ5w8K3VTIIG0bGc8XXR2 tTX4xBRN8A6er3epgrOFHsnIlpOsyECE881dWtQkrlK8m3nFLFMCVRzEGB/iHL04OMp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NQFWF2V6hc1eZwSELRGYzbc1N5pjFIuBSfk2c7I0Slz2Dhebq qk9LtQMCEYBg1szSiEHaKyuGhxyB7lu0v410lZ9e1IP0LfsT9q4GjVcDDcrcq/xud0AUj+zUx GuwS1iJ9diZsuvfqRIRa2QlmnIH0N00pwLEdI4I/GB/1seGU1gubmKOw0Ujf1LBDSYP5c4DA6 r6juNWZbSCie2z7xwfoq52V6+BqOjLue2mk Subject: Re: [VOTE] Voting opens for str_starts_with and ends_with functions From: cmbecker69@gmx.de ("Christoph M. Becker") On 08.07.2019 at 15:05, Andrew Gromov wrote: >> Please don't switch behaviours via flags: separate names and >> implementations are much clearer and much simpler to follow. >> >> Yes, you will have multiple variations, but that's fine. > > > It is depends of preferences. > > In my opinion, create new function for every possible situation is more > worse > then use flags. > > > > Python > > > str.startswith(prefix[, start[, end]]) -> bool > > > > C# > > > public bool StartsWith (string value, bool ignoreCase, > System.Globalization.CultureInfo culture); > > > public bool StartsWith (string value, StringComparison comparisonType); > > > > JS > > > str.startsWith(searchString[, position]) > > > > Kotlin > > > fun String.startsWith(prefix: String, startIndex: Int =3D 0, ignoreCase: > Boolean =3D > false): Boolean > > > > R > > > startsWith(str, pattern, trim=3DFALSE, ignore.case=3DFALSE) > > > > Scala > > > startsWith[B](that: GenSeq[B], offset: Int): Boolean > > > Golang, java, C++, Ruby, Swift have simples syntax, like > string.startsWith(prefix) > > > > C#, Kotlin, R uses flag for ignore case. > > > Anyway, I can't find language from various TOP-lists where present separ= ate > function for case insensitive operations. > > > Another note - I see that many languages provide =E2=80=9Cstart_index=E2= =80=9D parameter > for > start_with functions. > > > So=E2=80=A6 As I say - this is good rfc in perspective, but more discuss= ion is > needed. FTR, there is already substr_compare(). Thanks, Christoph