Re: Add form feed as a whitespace character in trim, ltrim and rtrim

From: Date: Sat, 27 Dec 2025 22:53:20 +0000
Subject: Re: Add form feed as a whitespace character in trim, ltrim and rtrim
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-129705@lists.php.net to get a copy of this message
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.)

« previous php.internals (#129705) next »