Re: RFC Posted for str_begins and str_ends functions
| From: | Simon Welsh | Date: | Sat, 13 Aug 2016 08:34:48 +0000 |
| Subject: | Re: RFC Posted for str_begins and str_ends functions | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95109@lists.php.net to get a copy of this message | ||
> On 2/08/2016, at 8:52 AM, will@wkhudgins.info wrote:
>
> Hello,
>
> I recently emailed the group about submitting an RFC for str_begins() and str_ends() functions.
> The RFC has now been officially submitted and is viewable at:
>
> https://wiki.php.net/rfc/add_str_begin_and_end_functions
>
> The github PR may be found at:
>
> https://github.com/php/php-src/pull/2049
>
> Hope to be hearing about this,
>
> Will
Firstly, the argument ordering is the wrong way round for a string function. String functions —
especially search-related ones — are haystack, needle (see strpos, strstr, strcspn, strpbrk, etc).
Secondly, I feel like this RFC does need to include that it’s a BC break by introducing new global
functions. A quick search shows that SugarCRM[1] already implements str_begin and str_end functions
and there’s likely to be other projects that do too.
[1]: https://github.com/sugarcrm/sugarcrm_dev/blob/ae189cfa4ed4edd6a4e1e0d9d1d5ec66f46a0b74/include/utils.php#L2082-L2090
--
Simon Welsh
Attachment: [application/pgp-signature] Message signed with OpenPGP using GPGMail signature.asc
Attachment: [application/pgp-signature] Message signed with OpenPGP using GPGMail signature.asc