Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129705 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 DE4A21A00BC for ; Sat, 27 Dec 2025 22:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1766876019; bh=EVln6gdi3L40KjitoPnLXGySWbo+leGhrPbmwxWsX/U=; h=Date:Subject:To:References:From:In-Reply-To:From; b=U/URljWDuL82d2cc6953JzXl1auSlX1xVkcd3UL1S+mMb9mFln8E1eWe4vWAY+sNT 1KksQshsFVU5IqW5jFxIE9VUD0+a4sWlTZVb0yJ68pUAT1psHbeppt0eRO0qUUNYst uggavAPPFAG7dNgu54CyPbWxC1ZFnL8MlEWMU4f5gsgr/XGkjTj99URMu1dVc2ly// 68AjARkAcd2kVUL2451XR7O2yRd28zeybHfHmi4dSmYeqXvoYePRHUO5pkPDEldnj2 GucNnk9z6R4AJACytJEKU/AsC9B1yN+9vQuT2fKltppAAntwvz2TlA6NY6PMoq2kmL cPfgIQKLWTY0g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0204818059A for ; Sat, 27 Dec 2025 22:53:37 +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.8 required=5.0 tests=BAYES_50,DMARC_MISSING, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from franklin.smtp.mailx.hosts.net.nz (franklin.smtp.mailx.hosts.net.nz [43.245.52.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 27 Dec 2025 22:53:36 +0000 (UTC) Received: from 122-57-27-239-adsl.sparkbb.co.nz ([122.57.27.239] helo=[192.168.1.67]) by franklin.smtp.mailx.hosts.net.nz with esmtpsa authed as varteg.nz (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim 4.96) (envelope-from ) id 1vZdA7-001zHZ-1L for internals@lists.php.net; Sun, 28 Dec 2025 11:53:27 +1300 Message-ID: <2e22df2a-bf06-40c2-8097-8f94b82d2e62@varteg.nz> Date: Sun, 28 Dec 2025 11:53:20 +1300 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Add form feed as a whitespace character in trim, ltrim and rtrim To: internals@lists.php.net References: <701b7ec.277f.19b5f634c4d.Coremail.lamentxu@163.com> Content-Language: en-GB In-Reply-To: <701b7ec.277f.19b5f634c4d.Coremail.lamentxu@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Hosts-DKIM-Check: none From: weedpacket@varteg.nz (Morgan) On 2025-12-27 23:38, LamentXU wrote: > Hi Internals, > > I have opened a Pull Request to add|\f| (form feed) to the list of > characters stripped by default in|trim()|,|ltrim()|, and|rtrim()|. > > Currently, the default behavior of|trim()| strips the following > characters:|\n|,|\r|,|\t|,|\v|,|\0|, and space. The form feed character| > \f| is notably missing, despite being widely recognized as a whitespace > character (in python, rust...). > Also in PHP, where ctype_space() recognises \f as whitespace as well as all of those that trim() removes. (As the name implies, of course, this is because \f is recognised as whitespace in C.)