Re: Proposal for a new basic function: str_contains

From: Date: Mon, 02 Mar 2020 19:09:40 +0000
Subject: Re: Proposal for a new basic function: str_contains
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-108814@lists.php.net to get a copy of this message
Hi, Philipp Tanlak wrote:
I like to elaborate on Nikitas response: I don't think a mb_str_contains is necessary, because the proposed function does not behave differently, if the input strings are multibyte strings.
This is not true for all character encodings. For UTF-8 it is correct, but consider for example the Japanese encoding Shift_JIS, where the second byte of a multi-byte character can be a valid first byte of a single-byte character. str_contains() would have incorrect behaviour for this case. Regards, Andrea Faulds

« previous php.internals (#108814) next »