Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130438 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 3C6991A00BC for ; Tue, 24 Mar 2026 19:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774380927; bh=/Tf/7eCm7HEj3D6CscaLrkfvXd0naCXkWbYEydQKPos=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=TLrCXiDHuE22GgLAz6u2TugKWtCAOacjjzug7cM4ZemNvawxxzi83J7LoNp3yY1Ss vIBicVXQPyaZPmrmbyC8YkLs9idttJjdKty/Y4ePeydO/2/SKnN2uKLPLMX1Ea0TER NF9tkwAx63HJ4U8GdIuZVLRimDNlp+0/uaUEsh++d0iSVwfuwNfJtaeAu/eMdsl3iF nxEdOW82sO4G864/aCe7T1jHCJ+09POZ4Y4XljBoxEJGyaM4GvAmpx5yrtiYcAqfPQ c8whEYnnh5WuGSfSyKeKd83LgiQV5MdTwIZU4iInMrMAZdLxT/YEMYmFB4j91i7HQb GUPOhZkmNWG5w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C144B18056E for ; Tue, 24 Mar 2026 19:35:25 +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_PASS,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from outbound.mr.icloud.com (p-west2-cluster2-host5-snip4-10.eps.apple.com [57.103.68.233]) (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 19:35:23 +0000 (UTC) Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-4 (Postfix) with ESMTPS id BA37218009AC; Tue, 24 Mar 2026 19:35:16 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=commonground.systems; s=sig1; t=1774380917; x=1776972917; bh=/Tf/7eCm7HEj3D6CscaLrkfvXd0naCXkWbYEydQKPos=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To:x-icloud-hme; b=TMK1+S+nDql3kRh2vu3YP9I/37NtSOdkt26oC7LMLOdQTzM6s7WssZsOl2nlo5ytUx3uw3+QKGnkikCGuAJ4LGpkPPOX05ITn5FJBGdAwJ7sMTjUxJaN4+UwlJnNb6PV8jfCTEItuZ/PQmp+tbwfRB3XsnGpB42OG5u++hpa2OnAfsFL3YJZzdtOoTneQOR5+7ENIlJcnBNtbd3qk1Xu88+UfZBMNc+RRQKdGHCqp0K+xLNOx5f9jNwkfOA2Jy+H8DaasFOdhOr37DYywmO9ksuK8pRlru3pfLVu+hQIimm9p9A+ku0+GTzPTlFa8rkazDwoDYSHcIXVv1LLTyj7Ag== mail-alias-created-date: 1673482948617 Received: from smtpclient.apple (unknown [17.57.152.38]) by p00-icloudmta-asmtp-us-west-2a-100-percent-4 (Postfix) with ESMTPSA id 276A818001F5; Tue, 24 Mar 2026 19:35:16 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: [PHP-DEV] [RFC] Remove \0 from default trim() character mask In-Reply-To: Date: Tue, 24 Mar 2026 12:35:05 -0700 Cc: LamentXU , "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: References: <3f4f6959.eaf.19cf0276cd8.Coremail.lamentxu@163.com> <4bf704c.b746.19d20d429ac.Coremail.lamentxu@163.com> To: Levi Morrison X-Mailer: Apple Mail (2.3864.400.21) X-Authority-Info-Out: v=2.4 cv=ELsLElZC c=1 sm=1 tr=0 ts=69c2e775 cx=c_apl:c_pps:t_out a=9OgfyREA4BUYbbCgc0Y0oA==:117 a=9OgfyREA4BUYbbCgc0Y0oA==:17 a=kj9zAlcOel0A:10 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KLhxIbIRAAAA:8 a=_cmBaCE0WJ9L5bvR8d8A:9 a=CjuIK1q_8ugA:10 X-Proofpoint-ORIG-GUID: CrVYuyi13kQDMTCnD9lWT5Hv_Aq1pgIW X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzI0MDE1MSBTYWx0ZWRfX+kWjnhjxj29Y 7h0ssgTad3v7yHozR10u1mmL2enPluVedSrrUwMZWU3jQkfPPDopxOaFUZa7ppoDjwF5BZ1getx v1jT70wuED5vMZugGEFE3eprJvzR4+vsK+KZyEURCR8dfvhrgu6zGbhKRepWTdVQISjSW7Cv8Rw GqDTKWd+maC3J2GqqJ3/zqhBltDgXAkY/9pyv1t5Pg3f0zRwnweSZ8/m8OOR1ymBJzKyDh4Uc7Y N2P0PRzu2krk0zeVjzoRr5wacyl28mGWKTu2PRCcCJP8leFBX4a6Dl7WHxnNgqwAp4uFKtN+Unp Np+/YGG7D5mdRugEzzCoDYFCOb59V6f41tTKhxzUg4A50h/9DAYnHQscHVkNwA= X-Proofpoint-GUID: CrVYuyi13kQDMTCnD9lWT5Hv_Aq1pgIW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-24_03,2026-03-24_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 clxscore=1030 phishscore=0 spamscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2603240151 From: andrewf@commonground.systems (Andrew F) On Mar 24, 2026, at 11:29, Levi Morrison = wrote: > 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. >=20 > There hasn't been much discussion, so dear internals: are simply busy, > un-opinionated, or what? For what little it's worth, I can't imagine any practical situation = where this change would be helpful. Using trim() or its variants on = binary data is likely to result in that data being corrupted, and this = will continue to be the case even if NUL is not trimmed. Changing the = current behavior is likely to break userspace code which depends on the = current behavior. If, for some reason, users find it useful to trim = specific whitespace characters from binary data, they can do so by = passing a $characters mask to the function to fit their needs, rather = than changing the function for everyone. -- Andrew F=