Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108819 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36391 invoked from network); 3 Mar 2020 11:45:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Mar 2020 11:45:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 959FE1804D8 for ; Tue, 3 Mar 2020 02:04:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 3 Mar 2020 02:04:31 -0800 (PST) Received: by mail-il1-f177.google.com with SMTP id e8so2190247ilc.13 for ; Tue, 03 Mar 2020 02:04:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=KVEBjkOXKTRq69fbisVPogQBDt/TZplIXSZ8nupkfVg=; b=QlEzoI1c1tTWlSKuvSGqtHSEV1Y7OYg1JW1Tqa7l/9QfkZ1YBGnwlUAdcrEuyVVng7 6xBMFYMjzuWnfaJRXGg6koQ1xoWeB3jE9zuRIXKB4jXwl9KFMBF3tGHYZ14on4oDUHRl MFUPbYutOTJuE0b+w6YJrGe9ub1B09qAafyMsHZGNGbv2UtWWLY/oqwDH4p/tkSFNW/n luwc5ZPtymYNRgXZq51rwziQLmqKbEoVKrDW3xEZA3TpKuEORT35YQoWGIhhERuZh3jZ JXVQWfx6oBI8/TiWPF8KBaxDwkuHZQ8mKNKc1rK2rvl5tvJE3mWSOitjtWLiGM2ZW5oU TzxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=KVEBjkOXKTRq69fbisVPogQBDt/TZplIXSZ8nupkfVg=; b=mwl1z/KucBODWaUbPbluEx9eDLBcAEiQUMj+bxmr8ObqfVpGpocjIZCYPAliin1Emk AnBKgPLBpZxZ1k2X0yl6uT8692GHMyFZ7xdGtS/hXOaUGNWq1erTgEw9YR7AcTOWxlgH LuFZoAP+yjCM12DvgiZ54KiNL7JKfekOXGUDZgVi9HvYfYlBoTIJ9Y9uWZx7ah6nSkwH XyK3Cw3lc+LV4j+ODFekoxzEvVH1SwimP8GHA7x3z0qayP2v56ktJNw8EErot9w/sWez fzP7sO0Nmuw4BM1m7cUpHTZb5ZuaZuaNy4GtbUZ5E8nRUrjXKNJjBu+qCaAmxl5+qMEh 074w== X-Gm-Message-State: ANhLgQ0JreXphIFTLUneV6txaDzYMTD0C0f3uaNBHUlsqfWrb10ct6WV 5fdh6F2UvLBEwVbPWSDgG6dyeWXApMVX6VQtXzH3Bg== X-Google-Smtp-Source: ADFU+vurIT+x1K1qc0TnJLUqM+KqZRKRA3/bCSJ/cXIOpYoCvPu64ZOf1PErMHEssOdmU/YmdytXDc85zBxfFqesHEs= X-Received: by 2002:a92:ba06:: with SMTP id o6mr4123768ili.206.1583229870417; Tue, 03 Mar 2020 02:04:30 -0800 (PST) MIME-Version: 1.0 References: <704fa268-6194-0ec2-d6b0-8f5efdf1009f@heigl.org> In-Reply-To: <704fa268-6194-0ec2-d6b0-8f5efdf1009f@heigl.org> Date: Tue, 3 Mar 2020 10:04:19 +0000 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000062a37059ff06efd" Subject: Re: [PHP-DEV] Proposal for a new basic function: str_contains From: rowan.collins@gmail.com (Rowan Tommins) --000000000000062a37059ff06efd Content-Type: text/plain; charset="UTF-8" On Tue, 3 Mar 2020 at 08:46, Andreas Heigl wrote: > > While it is mainly aimed at being a mere convenience-function that could > also be easily implemented in userland it misses one main thing IMO when > handling unicode-strings: Normalization. > > While I would love to see more functionality for handling Unicode which didn't treat it as just another character set, I don't think sprinkling it into the main string functions of the language would be the right approach. Even if we changed all the existing functions to be "Unicode-aware", as was planned for PHP 6, the resulting API would not handle all cases correctly. In this case, a Unicode-based string API ought to provide at least two variants of "contains", as options or separate functions: - a version which matches on code point, for answering queries like "does this string contain right-to-left override characters?" - at least one form of normalization, but probably several If there was serious work on a new string API in progress, a freeze on additions to the current API would make sense; but right now, the byte-based string API is what we have, and I think this function is a sensible addition to it. Regards, -- Rowan Tommins [IMSoP] --000000000000062a37059ff06efd--