Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129708 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 6B0741A00BC for ; Sun, 28 Dec 2025 07:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1766906856; bh=6qpdRNKEd5CGr1qJ9jg4uPGE96dbEKTWD/mEzxJEhJw=; h=From:To:Subject:Date:From; b=n9lIivpuyk55GN6W1rWmpRz14zIbkcgY3dWEPh8+m8PH9yhnTzlwEUUJ9NQtq3pYd f8yTGcZKSN3iJi6zLRH5vT++wez4zDIoMSExrWoFd5R59xROSHzGbBEoR1Xaalzing hVLcdHvdNjx6rmxUrruKCTu+23j8MSlxpXtbzC/kd7ymQNw7X7ZZlBSZHLKJYP3pw8 gX9yIAowEqlzDXa6sGF+QQwsVIdO90BJUPwcbPtBgDaKtMwTvzVUA+SQY/JVFij4YV rLWFsQTNWcpSa86zERgvs1w4gy9nvMepvArp1GVkxe7rILAprn5Dt+bA4QayHiBi1n Zs1dXBhBHHAfw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 88274180053 for ; Sun, 28 Dec 2025 07:27:32 +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, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (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 ; Sun, 28 Dec 2025 07:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:Content-Type: MIME-Version; bh=6qpdRNKEd5CGr1qJ9jg4uPGE96dbEKTWD/mEzxJEhJw=; b=cjMBwaItQAwaKGYqZtoavRPxRuJMKhPPl1DJit9K3QLEzWrdgRJjXnn3Ejp7Qh 7yhakGX+Votu1QensQWg3Sm8RxI7I+FzjPXfVPaCMB9+O+Lyz/qAtsmfmsCsJxtt k9fMG0BjfTFZlgNxX8MHSfhUut3IrYZJ0u3ErLcZVTT7k= Received: from SE2P216MB1941.KORP216.PROD.OUTLOOK.COM (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wDnd1vY21Bp+9s3DA--.50986S2; Sun, 28 Dec 2025 15:27:21 +0800 (CST) To: "internals@lists.php.net" Subject: [PHP-DEV] Re: Add form feed as a whitespace character in trim, ltrim and rtrim Thread-Topic: Add form feed as a whitespace character in trim, ltrim and rtrim Thread-Index: AQHcd8pK2KizYySOckOIkSAvAKFKOg== X-MS-Exchange-MessageSentRepresentingType: 1 Date: Sun, 28 Dec 2025 07:25:40 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-Exchange-Organization-SCL: -1 X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 msip_labels: Content-Type: multipart/alternative; boundary="_000_SE2P216MB19412F5DE0D49ED6DF7280A2FFBEASE2P216MB1941KORP_" Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-CM-TRANSID:_____wDnd1vY21Bp+9s3DA--.50986S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr1kWFWDKrykXr4fXw4UXFb_yoWfArb_Zr WkJa48Cw4UGrs0qwnrtwnYqr47JFs3uryUJry3tr1DuryrXrZ5XFy8uFnxZrykJw4DZrn0 gFWYvFWjv3WaqjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRRGQ6tUUUUU== X-Originating-IP: [2603:1046:c07:c4b::5] X-CM-SenderInfo: podpv0xw0xqiywtou0bp/xtbC2xmbSmlQ29k6agAA34 From: lamentxu@163.com ("lamentxu@163.com") --_000_SE2P216MB19412F5DE0D49ED6DF7280A2FFBEASE2P216MB1941KORP_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 T24gU2F0LCAyNyBEZWMgMjAyNSAyMzo0Mzo1NiArMDAwMCwgTW9yZ2FuIHdyb3RlOg0KPiBPbiAy MDI1LTEyLTI4IDExOjUzLCBNb3JnYW4gd3JvdGU6DQo+ID4NCj4gPiBBbHNvIGluIFBIUCwgd2hl cmUgY3R5cGVfc3BhY2UoKSByZWNvZ25pc2VzIFxmIGFzIHdoaXRlc3BhY2UgYXMgd2VsbCBhcw0K PiA+IGFsbCBvZiB0aG9zZSB0aGF0IHRyaW0oKSByZW1vdmVzLiAoQXMgdGhlIG5hbWUgaW1wbGll cywgb2YgY291cnNlLCB0aGlzDQo+ID4gaXMgYmVjYXVzZSBcZiBpcyByZWNvZ25pc2VkIGFzIHdo aXRlc3BhY2UgaW4gQy4pDQo+DQo+IFVoLCBleGNlcHQgb2YgY291cnNlIGZvciBOVUwsIHdoaWNo IHRyaW0oKSByZW1vdmVzLg0KQnkgdGhlIHdheSwgSSBkbyBub3QgdGhpbmsgTlVMKFx4MDApIHNo b3VsZCBiZSB0cmltZWQuLi4uLi4gSW4gb3RoZXIgbGFuZ3VhZ2VzIChhdCBsZWFzdCBweXRob24g YW5kIHJ1c3QgYW5kIGxpYmMpIE5VTCBpcyBub3QgYSB3aGl0ZXNwYWNlLiBJIHRoZXJlZm9yZSBv cGluZSBOVUwgc2hvdWxkIGJlIHJlbW92ZWQgZnJvbSB0cmltIGluIHRoZSBmdXR1cmUsIGJ1dCB0 aGF0IGlzIGFub3RoZXIgaXNzdWUuDQpJIHRoaW5rIHRoZSBCQyBicmVhayB3b3VsZCBlZmZlY3Qg c29tZSB1c2VycyAoZXZlcnkgQkMgYnJlYWsgZG9lcywgYnV0IHRoaXMgb25lIGNvdWxkIGFubm95 IHNvbWVvbmUgZXhwZWN0aW5nIFxmIG5vdCB0byBiZSB0cmltIGZvciB5ZWFycyB1c2luZyBwaHAp LiBJIGFtIG9uIHRoZSBmZW5jZSBhYm91dCB0aGUgYnJlYWsgdG9vLCBidXQgSSB0aGluayB0aGUg Y2hhbmdlIGRvIHNlZW1zIGdyZWF0IHRvIG1lIGFjY29yZGluZyB0byBvdGhlciBsYW5ndWFnZXMn IGJlaGF2aW91cnMuIEkgaW5pdGlhbGx5IHRob3VnaHQgdGhpcyBpcyBhIGJ1ZyB3aGVuIEkgZGlz Y292ZXIgdGhpcy4NCg== --_000_SE2P216MB19412F5DE0D49ED6DF7280A2FFBEASE2P216MB1941KORP_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
On Sat, 27 Dec 2025 23:43:56 +0000, Morgan wrote:
> On 2025-12-28 11:53, Morgan wrote:
> >
> > Also in PHP, where ctype_space() recognises \f as whitespace as w= ell as
> > all of those that trim() removes. (As the name implies, of course= , this
> > is because \f is recognised as whitespace in C.)
>
> Uh, except of course for NUL, which trim() removes.
By the way, I do not think NUL(\x00) should be trimed...... In other langua= ges (at least python and rust and libc) NUL is not a whitespace. I therefor= e opine NUL should be removed from trim in the future, but that is another = issue.
I think the BC break would effect some users (every BC break does, but this= one could annoy someone expecting \f not to be trim for years using php). = I am on the fence about the break too, but I think the change do seems grea= t to me according to other languages' behaviours. I initially thought this is a bug when I discover this.
--_000_SE2P216MB19412F5DE0D49ED6DF7280A2FFBEASE2P216MB1941KORP_--