Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108814 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 28770 invoked from network); 2 Mar 2020 20:50:44 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 2 Mar 2020 20:50:44 -0000 To: internals@lists.php.net References: Date: Mon, 2 Mar 2020 20:09:40 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 176.10.220.185 Subject: Re: [PHP-DEV] Proposal for a new basic function: str_contains From: ajf@ajf.me (Andrea Faulds) Message-ID: 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