Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130453 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 01C361A00BC for ; Wed, 25 Mar 2026 15:39:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774453158; bh=9ZZDb6hvjuQV7eF7ol2hgYocdBBlE+OzN2EKgrh2JYU=; h=Date:From:To:Subject:In-Reply-To:References:From; b=dcZzFnSjIquUN58bwGDHMp6GHvocvfBREzMuuDREIm9WbhJ8DLl5vOtzqrDE/jhwz 7Qs2Uilk8o+Aphq4EPdlPQ/7N7h4D5kvQNGDJGwQ2uK4Tzg+/LB93YsbJNCiVCcGVQ r4dRBNgXxzQLWiTl12Sksz+CzfMJK53dFyKJyp3DCEXQrS9/wXywctZY1rk51ugDED fkxeqcnuZP7UShj03ZdIjOlOZHnDkg4YhiZEmrUo+qqZyCMHwTPjiFP5j9mr2nEFyL vwm36xpdFwwqq9joO/uo9aNfGGZqOaw7NsEnNJsNHcm9yEC/32OHyYQyU1zjBDGcaa UR1OzAFesFwqg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BD4C0180068 for ; Wed, 25 Mar 2026 15:39:17 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) (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 ; Wed, 25 Mar 2026 15:39:17 +0000 (UTC) Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 1238114002E8 for ; Wed, 25 Mar 2026 11:39:12 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Wed, 25 Mar 2026 11:39:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1774453152; x=1774539552; bh=9ZZDb6hvjuQV7eF7ol2hgYocdBBlE+OzN2EKgrh2JYU=; b= DZ3nC1jdBusCc0OcXg/CEk+zt3C37OybGCS8eSUCXqab9BIkSkZP39OQjBZgFeH3 de1aYs/lHs9JXP5mfZsQiHGJ40Lhno6ZE4D1hmXd2Qko3NC79qjv44TnJb4mrekx G8QCTwkBDXa44QpxKBYMm5u4nPh7ejqiIZeUvGgyDi+92AN1kPUuWyO2ZenH51L3 uhir8XcJmkzNj3YvQlUw/1jER62lwBpJDyc8f6akld92tNqHMIJmg9tlZ9ZTUaoA SIsv3T5FH5Ajevv+YcpbPwK+AYs+hACc5evjAEaRqkmdxmWnXULQj/D1j+bctOqt prumvEVRnHYSvBZDa4SYcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1774453152; x=1774539552; bh=9 ZZDb6hvjuQV7eF7ol2hgYocdBBlE+OzN2EKgrh2JYU=; b=3lStCRjkcfB7uyMQf uWm0x/kPhFouFN1XRGxcn7OgzB1XZaCmrDzMiQFPszz463XOxLlt09JnuA9C6f6f MGv6ixtb0rdSPxhRaVEYPj5jA2h2puRuA4f+9q8zbb46aeN1Mwoy/j2GmpVrDE9j b9CLW9BnALV4QsGaytfdR1jI7y16LWFFxKv30fHZjP53AUg0iOEhykY7X9MSH2os DJB249NbY+KLcNtdO1FY/vUUpiD3dVyDfUWPBf0pMz9bN1auBu65kNQ12eKOLFa7 uOicI2gFeu9AP3crncaWOtKUmIZlL1ajChIA13UhwseXWsRuBgPjKLJpbV+4FfIO nkG+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdegkeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpeffhffvufgfjghfkfggtgfgsehtqhhmtd dtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceo ihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeehle ffteeigfevudetfedugedtudevledugeeugeelheeihfehgfdtkeevvefgleenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphh hpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 25 Mar 2026 11:39:11 -0400 (EDT) Date: Wed, 25 Mar 2026 15:38:05 +0000 To: internals@lists.php.net Subject: Re: Re: [PHP-DEV] [RFC] Remove \0 from default trim() character mask User-Agent: K-9 Mail for Android In-Reply-To: References: <3f4f6959.eaf.19cf0276cd8.Coremail.lamentxu@163.com> <34d24237.5453.19d23a29ea4.Coremail.lamentxu@163.com> Message-ID: <7AB86ECB-8D0A-4B8A-BF0E-C6C1C7CDD663@rwec.co.uk> Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 25 March 2026 08:23:38 GMT, Robert Humphries wrote: >I think it would be useful if there were some examples of when you >would want to be using `trim` but _not_ trim NULL bytes=2E The examples >in the RFC currently show the expected change in behaviour; which is >good - but you could also achieve the same effect by not running >`trim` in the first place, as the only character in the examples that >is expected to be removed before or after the change is the NULL byte >(even in the example with a new line followed by null bytes, after the >change then the string would be identical to before the `trim`)=2E I second this request, and would go further: the examples should show a si= tuation where you *do* want to trim other "unusual" characters like "\v" an= d "\f"=2E The RFC talks about corrupting binary data, but wouldn't trimming *any* by= tes from that data cause corruption? If you know the data is padded by a *s= pecific* character, then passing that character to trim() explicitly is the= *only* safe way to use it=2E PS: Please can everyone remember to start your reply *below* the text you'= re replying to, and *trim* parts that are not directly relevant=2E Rowan Tommins [IMSoP]