Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130493 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 342611A00BC for ; Mon, 30 Mar 2026 11:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774870255; bh=4lNl/1TFyzBDsr75O7WxTbl0NV79lVzdzW2ztY3DGnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q0yqaNEztonFrF3NnEQSQ4n5ae1At70H2q65cL2xGOR2beeXQwwlWptsBBj9WCh/X gdFuWhtLbFTgcKxFX28w0ZnAEMG6IK73c/CvMmzwSjU8E47H9Kig6gcAgM3/DzAJ7Y 1EIpWAf1moGfcCW/v/B5C3S9z815SgHZh2YaP6u9YEYaTkUB1O6o0oUhZqXet/5UZ2 a+KEG/igYDwmKF+S23BdHMevKAnd29PqQNpHr9LE332JhoaVUB0rlGu7ARDcaPa2D2 dEQ2yqkDNMiCyJAX7TRSLv0EEHWSjUDVs986EEEMggT2A0C+RuZSqLxqgt0zec5PF+ jV0DTRiCcRT1g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 37C86180068 for ; Mon, 30 Mar 2026 11:30:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from sonic.asd.mail.yahoo.com (sonic-euwe4-0022.asd.mail.yahoo.com [34.2.86.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 30 Mar 2026 11:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1774870247; bh=IO/oNxfXZlXKoRS6nZ09lWpuGbzURUOWMq0ZgkVfNhw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=BNno8Oq3B7nD53W4u26Tn0ctGtOwLY4b70ycrbYOOA807uGNFzSajsh46wKuZi5nn0U3FG86c3Qhqdk+w2d0YAQQ41c6odD4xVO8bTwFNjWDANNjH8pxOEI2TEt90kRT5jUUJXGsOvLd1dMOBOWH8pA/g6TGf6yPN7AjWiCD/tb7+ePyXmPv/oW8wsAb4JUMKspum1lYrrRLrbzbB8sGUiJlt8EShBr2GsePghnT5YgK4dANWzljhmbi8WGHJeZ3WAnpGW79rHMMvDGz96lh5JicsZ0QbIWzvzRYNN1tx4QKjMPDItqR5VjgnjJlq4y/7Dmgr0JRqNpmQjDIH+qWzQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1774870247; bh=dsAdv+j+37jhAx9Z0NkxLstLcUT7CqMqxg1x8JDw1w5=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=oc8yFzWwSjTbjCfkKh/Tl1GRcYv/NG9QJd66Kr1jl+Ar1XSsDBGTk4KiIW6WktVTKFQY0t3Y51T9Sd2fyCjH32rJF9/+pT/0azqMyoHUxSHybtXr9ptAjBocxoS87dot5ClU5rjscri+/h+K3LFJU+eJ7NI7dSLHnPnGPREcVXiavDdM0xpLZDNrYjeHK3AYlkQwQ0TZOtTbEnwxLQhSTswHtGxYVDb79yzcor7wOEq0/rUKZvtmBO+eqChkoVwmH+KW+VOz42kuLYIi/XCqDktD0PvJtrdt8fP0dIObJiAvYr1N/ZWIuW2wsh1VdXB80Gq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nmhCib653w2eFFO8LfvsmVhiyvjAuSy0i5CNzTp9Oen8VFRML2HFusUfhYB4g kn28SaBsHL3nnTBUOul7_8B20xSRo._dErPXZ.AaVi8bpGgVUGf7Pfe6VRKff86o_7XFRvBcY51j B1nAk_WMUl7tgtdxKDFA9PAY_OWlf.AxNqxrGxkP77jvqdI50R91d7PSdOhjaD489DSjb6A10IMi tpJb0lgO_QtoAfMErQcHmmjuIBhm3S.Jx95BSfKxHAPVqk6LJCkNf7r3.uJNXKKP2GCWS1fh7B7s tCBiJF56.oZlRKfyTfk38q7Al7ekQgRBB9Rk5r4mI.T5.iSOeVAfxF8.uWndaO1J7oFuf8In3V3I RDKzyb54qslz98eml79SxJhhbcihqeFuJ6KiUG8ofCnRYqS3GGNISKRMwgwaRqhVWRuN4bqW.0OD l.OKd1dZ27QFwGIb9qA9PkdpWAc9f2.9Yh2p5Qq0mi.xKO84K5B7dFIkPVdiXw1KKpb7BeRQN_vA sSagg3vissGE_hiySMTLJJd_1mHWL5WrJTNH9CMcEjzaObhM4Y2OqZ_p_PX3h1ekDVgMQWWO9Np5 tCcxfET..gaphhjZSen1rxDm_O6Go.YKNGHRmvIwmGqZqEC5HfrMi.w5JFWbhMrH8BTniRoOqnnF ewa9zH6zXxWtkLqc.nleghXRPIT.OwYRejK_AnCKTXWR560PLocz5oygXApZlTE3Q70eC0nLpcRd YEsGc_r_S_sSxuCWL0XKbi9G9DvQv8JfU7ThESJtEq74Zc2YZcJER3s2fBsT64AZ81NCDOciRhG0 j6k7k3u.4ip54Sx3AauZ4o.bxV71IJCZZVGSPP1lJKNwxFBw7WkbsKasm4tmH7CDxSmPidzwFBNS Rh35Ju9o1n7Fi1wcDFCdgGmxi8X6VA3YOFqh1J5zO2ZB9XjJ_g4jufCiv X-Sonic-MF: X-Sonic-ID: a6a05365-6206-4b1c-8490-e83a2c8ef234 Received: from sonic.gate.mail.ne1.yahoo.com by mail-asdoutdeli-p-cin-euwe4-prod-sonicconsumer-svc-102 with HTTP; Mon, 30 Mar 2026 11:30:47 +0000 Received: from dip21.lsn.ir2.yahoo.com ([87.248.99.30]) by hello (SMTP) with SMTP ID 4b9660df5ee02e1f314c6102ee948297; Mon, 30 Mar 2026 11:30:46 +0000 (UTC) Content-Type: text/plain; charset=utf-8; format=flowed Message-ID: <1774865754117.837705560.675399630@yahoo.de> To: lamentxu@163.com Cc: Ilia , internals@lists.php.net Subject: Re: Re:Re: Re:Re: [PHP-DEV] [RFC] Remove \0 from default trim() character mask Date: Mon, 30 Mar 2026 11:30:45 +0000 In-Reply-To: References: X-Mailer: Vivaldi Mail User-Agent: Vivaldi Mail/7.9.3970.45 Content-Transfer-Encoding: 7bit Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 From: hanskrentel@yahoo.de (Hans Krentel) On Monday 30 March 2026 11:46:11 (+02:00), LamentXU wrote: > Thank you for ideas! AFAIK here are my thoughts on this > > > Now I realized the point that, those trim functions are not supposed to be used to remove whitespaces in strings, which solves my main concern that NUL is not a 'space' character. > > > > On top of that, we still have security concerns (and more) for this change, **and therefore I would like to withdraw this RFC.** > > > Moreover, the proposed new function 'trim_whitespace()' seems to be more reasonable for people to use to strip whitespaces instead of casually using the trim family, which would obviously be a better solution in this case. > > > Thank you for your attention and suggestions! Thank you! And yes, the security thing is the blocker on NUL, but if trim_space() idea clicked, and given your interest in topic and the bit precision you've shown, may I ask you if you have some interest in implementing it? Take your time for the answer, just sharing that I think your spotting of the "missing \f" shows attention to detail, and this is certainly both required and trim-able when there is need to delve into UTF-8 for the new idea (I have borrowed it from Golang as you wrote in both of your suggestions we should do more language comparison, which also was very insightful for me, so thank you for that, too!) Apart from that, what are your thoughts about/for a constant preserving the original characters so in case the first change poses a problem for language users, they can find it and go on with it? -- That was a question raised shortly with the first RFC, in how far the change will introduce problems (albeit no one wants this), but because \f is that old it is hard to answer that question technically I think (even if we scan tons of code-bases for usages), so probably my thinking was that we should not leave users alone in case it is an issue for them and with a standard constant Tim or so can do some compiler string magic probably even. But that might be a bit my fantasy, we would first need to have a constant(?) before it could be discussed with him/other PHP compiler people. I'm open for other ideas/thoughts as well, the constant was a bit of an after-thought when writing, and it's good when you stay in the driver seat, I can only try to give some explanation when I see it or you ask and offer help with explorative testing. You own it, you make it out! Thank you again! -- hakre