Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106162 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79012 invoked from network); 8 Jul 2019 12:56:08 -0000 Received: from unknown (HELO mxout2.rambler.ru) (81.19.78.101) by pb1.pair.com with SMTP; 8 Jul 2019 12:56:08 -0000 Received: from saddam1.rambler.ru (saddam1.rambler.ru [10.32.16.1]) by mxout2.rambler.ru (Postfix) with ESMTP id B40E18DC121; Mon, 8 Jul 2019 13:15:29 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rambler.ru; s=mail; t=1562580929; bh=Ik+abTU2DSplMEEgEZsgoNofdpwZYli84mnWbTvkaws=; h=From:To:Reply-To:Subject:Date; b=QGd5FNQ0lUGSoLqS6VeZ49nzKQhQm8uINyrH3PX5BIFf+zfWXBCLj5hDPjEzibnws kHnO59w8oHhnHK901YR4PiNQUqkFaosffafa4B3XkXl984X6JWnx75787CRfAG0KMX bL+el9yRGkW7GAeR2twetLAmt7QdZ3o9M/tj/lf8= Received: from localhost.localdomain (localhost [127.0.0.1]) by saddam1.rambler.ru (Postfix) with ESMTP id 8DF69504C53; Mon, 8 Jul 2019 13:15:29 +0300 (MSK) Received: from [31.173.94.241] by mail.rambler.ru with HTTP; Mon, 8 Jul 2019 13:15:29 +0300 To: "internals" , "theodorejb" Reply-To: "Andrew Gromov" Date: Mon, 8 Jul 2019 13:15:29 +0300 Content-Transfer-Encoding: 7bit Content-Type: multipart/alternative; boundary="_----------=_15625809292748724" Message-ID: <1562580929.565898.27487.49640@mail.rambler.ru> MIME-Version: 1.0 X-Mailer: Rambler WebMail, http://mail.rambler.ru/ X-Rambler-User: andrewgrom@rambler.ru/31.173.94.241 Subject: Re: [VOTE] Voting opens for str_starts_with and ends_with functions From: andrewgrom@rambler.ru ("Andrew Gromov") --_----------=_15625809292748724 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; format="flowed" > For those voting against adding these functions, can you clarify why? > Do you dislike how they are named, or do you not see the need for the > case insensitive versions, or is there an issue with the implementation? I believe that star_with/end_with is useful, but not in this form. The standard library has 98 string functions with different naming styles. Adding 4 more (8 for mb_) functions for actually two(one?) tasks is redunda= nt. I think that more discussion is needed. My preferred variants: 1) One function ```php str_contains( $haystack,=20 $needle,=20 [CASE_INSENSITIVE|FROM_BEGIN|FROM_END|MULTI_BYTE] =3D 0,=20 [$encoding] =3D utf8 ) ``` 2)Or two ```php str_starts_with(...see above, but without FROM_BEGIN|FROM_END) str_ends_with(...see above, but without FROM_BEGIN|FROM_END) ``` Best regards,Andrey --_----------=_15625809292748724--