[php-src] PR #20788: GH-20783: support \f in `trim`, `rtrim` and `ltrim`
| From: | LamentXU123 | Date: | Sat, 27 Dec 2025 09:55:58 +0000 |
| Subject: | [php-src] PR #20788: GH-20783: support \f in `trim`, `rtrim` and `ltrim` | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-34392@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/20788
Author: LamentXU123
I searched keyword
trim in the codebase and fix every case I think related to the three
functions. I didn't touch other features with trim implemented and missing \f.
(such as trim in [php
filters](https://github.com/php/php-src/blob/77d306ef385e4f1108efab6f3f7a4ee28386d950/ext/filter/filter_private.h#L121)
or the behavior in php_trim_int (which effects php_trim),
[source](https://github.com/php/php-src/blob/77d306ef385e4f1108efab6f3f7a4ee28386d950/ext/standard/string.c#L524))
This PR changes:
- The default parameters characters of trim (also ltrim and
rtrim) in the php interface, adding \f,
[source](https://github.com/php/php-src/compare/master...LamentXU123:php-src:master#diff-96c05a0551ccbeca3ff610c111f88b54a0d727888cf353f477ea8dc951a18637)
- Test case concerning trim, adding case of \f.
I am sending mails to internals now. After that I will write the NEWS file (and docs) if this
feature is accepted.
doc of trim: https://www.php.net/manual/en/function.rtrim.php
This is my first time contributing to php so I am not so sure about this PR. Thanks.