On Sun, Mar 15, 2026 at 1:24 AM LamentXU <[email protected]> wrote:
> I am sending this to introduce my new RFC:
https://wiki.php.net/RFC/dont_trim_NUL
>

I'm not a fan of this for the reasons that several others have already
stated.  While \0 may not be technically whitespace, you have 30 years of
scripts expecting it to be trimmed and undoing that potentially (though
perhaps not actually) opens up new security vulnerability for dubious
gain.  I hope nobody is depending on this to remove *all* null bytes,
because of course it won't, but I fail to see how a text oriented function
(the notion of whitespace makes this not binary oriented) should be in
favor of preserving nulls under any circumstance.  If anything functions
like this which are specifically text oriented should (perhaps, but for
performance and historical raisins probably not) be elevated to throw on
discovering null bytes anywhere in the string.

-Sara

Reply via email to