Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130435 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 3BA1D1A00BC for ; Tue, 24 Mar 2026 18:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774378574; bh=GX2KIQLiWeEAnGAlVp6YoNJfpAhTHJ3mBYgA3QJGUv8=; h=Date:From:To:In-Reply-To:References:Subject:From; b=fC3+bOYV3KvvCAbR37FMp9/c1xTTPcQFkBw6XSjXqN1WX4TitFQScRiVMZtJxcHSV U1JlFcA99/Olp3jl01t+FZSVPkZQ4Pwn/SV6OWCCcX4ByrrVJNwZIPsLmdboxebRbB /rv9me2JfJ8tzrjUj5a4DHav7TsjxNnBptHFY5KV7WzcT8huEVJUg3fIv5SDEgHr3/ IYrXPotBm/mWBPfc0M6GVVoR7pS+7kvEY8yr8TT3W0daUqH6ajxfQGQN0yjKW5Dvat 9BCfLOeL9E/YnJAZoMckhlDgcVdo7PbkxpGkI0BctQx7h0yMGa6mU4ei+pC6MR5Hv5 JI3ttunUvIbxw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0FE3F180069 for ; Tue, 24 Mar 2026 18:56:14 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 ; Tue, 24 Mar 2026 18:56:13 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 452931400192 for ; Tue, 24 Mar 2026 14:48:35 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Tue, 24 Mar 2026 14:48:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm1; t=1774378115; x=1774464515; bh=nV3z7ff+IUq0aDaVUUAs1 o2/uB5mPLTmXQNOuwf1POA=; b=cOP0XAu/j6J14tBFeCPcAySlv0jd7OLTRRwHx HXw9KJYrq+En20ATjV++jiWgGLWl79DV5K/4CRZWHTpxe/3GIBKwdVBPk/AkbWNj KVujq0XsZiOCXE/L4YQQ7xuwKjnm9zmOZsOnbU5UqD+ntb7a09pFrHAXbNvTZyOZ uzKhUb36P/Foyo/GYizU99j9TXj6DELPNbyLxZwWuHJ+9AmUtOZbmcQhXTd0wWqO Q49UB82mrw3wtQeFhhSzBteovZmyMruyV8JVYYbElJuPoOAcrfGpADxfd++AwcBn P3yOXvRleoVvu1UnbWLL3Vh0aEVovpXQEcFW3PNSXIiRT9hMQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1774378115; x=1774464515; bh=n V3z7ff+IUq0aDaVUUAs1o2/uB5mPLTmXQNOuwf1POA=; b=wbXMm8fX4tG9rCY0M DKQlvHZhnGo3peIO5h5d1TZyA9I3mrIwMstchNg91ZOFP28dYRNdIQcJdZJNEqaP uujrb6KFPd79OHY+VVB09fo2oLj2BxQfxW02DkiBnHhFf4fbErjbMwAaIE20nVv3 mV4nfHGVYfcbAmjlnVZna+ZGK5Aqj+tXKXnwW62pKKlZDzuBLcRrNK5+KrCqvy5o TeSMCeCJ9vsTEE2pO+dtzLdDnavIvJ11+w95PORMl5/rwuMGLZfmHY3Fx6xC+nnt 3vm++dxjnjzJCnDSrSOC3uapT8noq+6WEyB9TUwqSdFArzvPR3UB3Sqx9wXG6PmD 0Qlbg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvddvfeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeehieffudduleffjefhteetveekjeevleduhfevteffvdek veejkeevleetudegffenucffohhmrghinhepphhhphdrnhgvthdpvgigthgvrhhnrghlsh drihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep lhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphhtthhopedupd hmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhs rdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 0DA33700065; Tue, 24 Mar 2026 14:48:35 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AmmoL4ez5Btc Date: Tue, 24 Mar 2026 13:48:14 -0500 To: "php internals" Message-ID: <62b2b27a-6a00-4340-a63f-e567d33aa280@app.fastmail.com> In-Reply-To: References: <3f4f6959.eaf.19cf0276cd8.Coremail.lamentxu@163.com> <4bf704c.b746.19d20d429ac.Coremail.lamentxu@163.com> Subject: Re: [PHP-DEV] [RFC] Remove \0 from default trim() character mask Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Tue, Mar 24, 2026, at 1:29 PM, Levi Morrison wrote: > On Tue, Mar 24, 2026 at 11:14=E2=80=AFAM LamentXU w= rote: >> >> Hi all, >> >> I believe the RFC =E2=80=9CDon't trim NUL bytes by default=E2=80=9D i= s ready to move to the voting phase. I intend to open the voting period = soon (typically 7 days). >> >> RFC page: https://wiki.php.net/rfc/dont_trim_nul >> >> This RFC proposes to remove \0 (NUL byte) from the default character = mask of trim(), ltrim(), and rtrim(), to align with common expectations = and avoid unintended trimming of legitimate NUL-containing strings. Plea= se tell me if there are any final comments or concerns. Thanks. >> >> Best regards, >> Weilin Du >> >> p.s. Not that sure if this email is going be be sent in the correct t= hread, so I would post the thread link here if it doesn't https://extern= als.io/message/130318 > > I agree that \0 is a control byte and not whitespace, so it probably > shouldn't be included in any of the trim functions. However, at this > stage in PHP's lifecycle I am not sure if we should fix it. > > There hasn't been much discussion, so dear internals: are simply busy, > un-opinionated, or what? No strong feeling on the matter, will probably Abstain. I don't think i= t's something that I've ever run into, since I tend to know very well if= my strings are bytes or characters and use them appropriately. --Larry Garfield