Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130452 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 0016E1A00BC for ; Wed, 25 Mar 2026 14:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774450098; bh=7DaSnM8aJPvUZ3pFwpjEit92/ONYamOgTWUUjvCChpo=; h=References:In-Reply-To:From:Date:Subject:To:From; b=Hqn16Q5uQFu+5zw82M248l5oRcm25caJE4yqon8+HxgqleJp2RQTOH2CZNabnithP pfwdAEI7F2lEztl/ShwpatXpTav90t6Q5VQIrwUJFbKCso2d8XGjMq7I/iWpr9WuVy rQFNOYQJnE4HFWxf6RtxFkxFZboaMGWsxgM63wr24gyIhmsfa0dz7tnOa7aNvQ79p5 +sdT/59dw9Zq39fgHEsgR+zWZhbtM8EMf35UvpbtVmEZfZcF7BQPSr2enRtmaVTxPH wNKb2QPcEvaDTWWy3MlZmEsRjatePbbxPLYI1AK5W7vpr8uQRrJoMb/eXT++54qOJv LLMZ8yLuDLk7A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B95771801E0 for ; Wed, 25 Mar 2026 14:48:17 +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.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (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 ; Wed, 25 Mar 2026 14:48:14 +0000 (UTC) Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-50b713d6baeso20155321cf.2 for ; Wed, 25 Mar 2026 07:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774450089; cv=none; d=google.com; s=arc-20240605; b=OTY1EuHNjyd/0ZBpIxEoOtd/Sl2Wqema2gXoI2Y8+Mef9OnYWxzJEWRJlNX+FEfZg3 Rf7sh+XCo64/e9J12HrhnK8kbQS9Oh47XNLvbx77oCFHjAuQG1LY0aIZ+BRmbMtmkcSB w0sSQ9iFRj9t7hZhrc9fcibo7nYbiIN6K/OdlkcCha6SExngQCQ5AdeXh3BxHN0X7fX9 EuRuAdSQzuCauI2D1R9stVaceAFBmoL2wh1xE0au1JqinxLhTBDQ1bbSLX2Hwu2+gpPO KnLnaIs1vWIjE/IGfeSTaIOeXuoW88POBw1btDOa6NRdo82aWKOB2Gk5xzYpc6rGuajb NM2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7DaSnM8aJPvUZ3pFwpjEit92/ONYamOgTWUUjvCChpo=; fh=ycOHSJ8H6TGy1UMhyRk/2DpdYsny+X3HKJ5PTIiqQiA=; b=I758BVUFemMwK+ldzeMtL8iGntdyPfHkIczpi/mUjRxJOCgcoV8aHgdZRvRrYJrGzK WoFeSSxINLFZEZ0fQzE4GbQ8HLugRueC+6p8DN6Xa3uowBi8TX3HjFXjpcV7jyQrPkt5 6ZVhcAv9MowpcEAvbcMscMSUO5rXwcmHZYrjVj/rhedsc1aCp/bNTNzUJ/mmXEc/JklP Y/xMib+FkUXLULhPKSOKqlqVznFT0fVfciftvCcHjZtsYi/SPcV+4u4CBwUtRuyuV4Og 3TYLnSBGknpqAJVIJMSX1vILMe0nYn5DNz4xZNrvsugnADyeE3sX8gZNJJO9SnnrcPPQ u4nA==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774450089; x=1775054889; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=7DaSnM8aJPvUZ3pFwpjEit92/ONYamOgTWUUjvCChpo=; b=qM+U/JCXQ1/6MN6lHx+A/DLZJZqzxtWl1oxiUoAWwqlERvdyK+HM0eJu7DK9I7v0PA 0FC+SKZDvRYdZALFxcIM5la2UdC8opDV350GRRu3+cGoGH1k4h8oDa+JVKQqSXqux11w E1Ffw7rbe6aKREcCRDNrsulzDcw9bu+jfsySh3VRqvZOLMlH3JZKZhMaTe7wj0eQO71j /D8Eocmt4SIm/+FLmIKhTZNep5S0j1DjCps+O5zPgASgYgp9LJC1/VQhG+UAZ6YHZzv6 6vst2YGY5NZFAWFlRQsMwtGJj/cRMKH0sPEG3puL0PDmiWGcjjyYS1ZMA7uu9PdYTi7G LWxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774450089; x=1775054889; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7DaSnM8aJPvUZ3pFwpjEit92/ONYamOgTWUUjvCChpo=; b=TAPbKiYL6Sr02UpGYNtFe1DFvYcA3yzpHssl9u1cb0ZT9kmCAVOgHnqCzHinYRaOat 2v891oKR3TysBha8qKlYOQynTBG/K7Io6GmGhzcP6eGvM/8mPQ0YptTYCV3kBWWDQbKB 4BufW/XbGstHpbgRUh+Gw6Ol43Xin0kG38trnEXvnKS3A2ynsxqatkI/JgS1azQspn2Z 04BHZGzoM1K+2M8Tu5hyi7RQRmK9WEfsCk8XBsmerQ//ooJf1ASW5bHh+FI4VRlNU070 ib+cuWvhZOWMf64P5vQYhejTqW70sv3FnMDOgOjeCYI3W48JM5polygrUzyRo3HJJVoq +Q8A== X-Gm-Message-State: AOJu0Yzn5shBYry9YawRypHH55iK3viZ82LKK1FE2oxUazWDt42/hDwc rFu2ESbUI1MxxHzdtyI+wdJ95v/ZVF8G754eNLjeNCZSPcRwVU4pZUiTrjHjWhUNzhS04GB7qgE hFQGtJFigEIv7FRR7zy9aarOe20BLl/9p+M7n X-Gm-Gg: ATEYQzy+8O18r74FENytsBfSpec6Fsl+Tlf8A/fsI532p2oAHMzsGdq+JAogjkRO8WD QVV254D1RrxKI2ywfY5s/iz+wTwOKqAfwmtUwsm6ZdhKleXjedNRkdh2iOgWp6sAenh0baiBi/R nWL64dXEYU6x9c5UiLUNypK4O/L054basI9nBImfDPGoNbRLmPWGRM/2RRmsosJFqhj6fxjfCjd ruzLccWtIzEYP26wXUYrwfOB3xhc/qTMPABPB9/ZlIBxWaNPf1cf3ULGQSjxpPtaThuWdj82ZqR gpgfexQ= X-Received: by 2002:a05:622a:28b:b0:50b:5258:28da with SMTP id d75a77b69052e-50b80cd383cmr55797481cf.5.1774450088841; Wed, 25 Mar 2026 07:48:08 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <3f4f6959.eaf.19cf0276cd8.Coremail.lamentxu@163.com> <4bf704c.b746.19d20d429ac.Coremail.lamentxu@163.com> In-Reply-To: Date: Wed, 25 Mar 2026 15:47:31 +0100 X-Gm-Features: AaiRm51SQMhOMz9OxX3bLSioc1g5Ntsl6eglPIhRQsa8076ZMFKt9nklpzUaYtY Message-ID: Subject: Re: [PHP-DEV] [RFC] Remove \0 from default trim() character mask To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="000000000000379443064dda5bf6" From: markus.podar@gmail.com (Markus Podar) --000000000000379443064dda5bf6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Wed, Mar 25, 2026 at 11:04=E2=80=AFAM Marco Pivetta = wrote: > > On Tue, 24 Mar 2026 at 19:29, Levi Morrison > wrote: > >> There hasn't been much discussion, so dear internals: are simply busy, >> un-opinionated, or what? >> > > I'd vote against this proposal: `\0` being considered one of the stripped > characters is now a downstream assumption, and this ends up being a BC > break with little to no advantages. > > From a semantic perspective, `\n`, `\t` and `\r` are also "control > characters" in other contexts (not the C world). > Thanks for putting this into clear works: this is exactly my fear too. Since the very first message of this thread arrived here, my thoughts were along the lines this is outright dangerous to do: there is "decades" of downstream assumption how this works and it's IMPOSSIBLE to properly vet this, as this operates often on the (potentially untrusted) input level. And, AFAICS, a perfectly valid workaround is possible by just providing as custom 2nd arg. IM(H)O this should never come to a vote, doing this shouldn't even be considered. sincerely, - Markus --000000000000379443064dda5bf6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Wed, Mar 25, 2= 026 at 11:04=E2=80=AFAM Marco Pivetta <ocramius@gmail.com> wrote:

On Tue, 24 Mar 2026 at 19:29, Levi Morris= on <lev= i.morrison@datadoghq.com> wrote:
There hasn't been much discussion, so dear internals: are simply busy,<= br> un-opinionated, or what?

I'd vote a= gainst this proposal: `\0` being considered one of the stripped characters = is now a downstream assumption, and this ends up being a BC break with litt= le to no advantages.

From a semantic perspective, = `\n`, `\t` and `\r` are also "control characters" in other contex= ts (not the C world).

Tha= nks for putting this into clear works: this is exactly my fear too.

Since the very first message of this thread arrived here,= my thoughts were along the lines this is outright dangerous to do: there i= s "decades" of downstream assumption how this works and it's = IMPOSSIBLE to properly vet this, as this operates often on the (potentially= untrusted) input level.

And, AFAICS, a perfectly = valid workaround is possible by just providing as custom 2nd arg.

IM(H)O this should never come to a vote, doing this shouldn= 't even be considered.

sincerely,
- = Markus
--000000000000379443064dda5bf6--