Re: RFC Raised for str_starts_with and str_ends_with
| From: | Nikita Popov | Date: | Thu, 26 Mar 2020 08:53:44 +0000 |
| Subject: | Re: RFC Raised for str_starts_with and str_ends_with | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109325@lists.php.net to get a copy of this message | ||
On Thu, Mar 26, 2020 at 3:36 AM <will@wkhudgins.info> wrote:
> Hi,
>
> Hope everyone is doing alright. I just raised a new RFC
> (https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions ,
> github patch: https://github.com/php/php-src/pull/5300) for
> adding
> str_starts_with and str_ends_with to PHP. I would like to open this RFC
> up to discussion.
>
> I raised a similar RFC about 9 months ago
> (https://wiki.php.net/rfc/add_str_begin_and_end_functions) that was
> narrowly rejected. A major criticism of that RFC was the inclusion of
> case-insensitive versions of str_starts_with and str_ends_with. I have
> incorporated feedback from that experienced and narrowed the new RFC to
> only propose str_starts_with and str_ends_with.
>
I was in favor of the previous RFC, so also in favor of this one :) These
are going to complement the recently added str_contains() nicely.
Notes on text:
> After that RFC was closed, a code freeze was in place for PHP8's release.
PHP8 has now been released and several individuals have requested the
str_starts_with and str_ends_with functionality again. This is a simple but
highly desired functionality for PHP.
I think you mean PHP 7.4 here. PHP 8.0 is not yet released, and not in
feature freeze either.
> Add str_starts_with, and str_starts_with_ci() functions
The second function should probably be str_ends_with() :)
Nikita