Re: Proposal for a new basic function: str_contains
| From: | Peter Bowyer | Date: | Fri, 14 Feb 2020 09:44:48 +0000 |
| Subject: | Re: Proposal for a new basic function: str_contains | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108563@lists.php.net to get a copy of this message | ||
On Fri, 14 Feb 2020 at 09:18, Philipp Tanlak <philipp.tanlak@gmail.com>
wrote:
> I would like to propose the new basic function: str_contains.
>
> The proposed signature for this function follows the conventions of other
> signatures of string functions and should look like this:
>
> str_contains(string $haystack, string $needle): bool
>
> What are your opinions on this proposal?
>
In principle, yes. There are a couple of considerations first, like how you
plan to handle case-insensitive matches; and previous discussions for this
and the wider context of related string functions:
https://externals.io/message/106162
https://externals.io/message/100142
https://externals.io/message/94787
https://wiki.php.net/rfc/add_str_begin_and_end_functions
Peter