Re: Proposal for a new basic function: str_contains
| From: | Claude Pache | Date: | Fri, 14 Feb 2020 11:41:20 +0000 |
| Subject: | Re: Proposal for a new basic function: str_contains | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108568@lists.php.net to get a copy of this message | ||
> Le 14 févr. 2020 à 10:17, Philipp Tanlak <philipp.tanlak@gmail.com> a écrit :
>
> Hello PHP Devs,
>
> I would like to propose the new basic function: str_contains.
>
> The goal of this proposal is to standardize on a function, to check weather
> or not a string is contained in another string, which has a very common
> use-case in almost every PHP project.
> PHP Frameworks like Laravel create helper functions for this behavior
> because it is so ubiquitous.
Some time ago, an RFC proposing to add str_starts_with() and str_ends_with() was unfortunately
declined:
https://wiki.php.net/rfc/add_str_begin_and_end_functions
<https://wiki.php.net/rfc/add_str_begin_and_end_functions>
Therefore, unless several people have changed their mind in the right direction since few months
ago, I am pessimistic about the acceptance of str_contains().
—Claude