Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129994 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 DEF1C1A00BC for ; Tue, 3 Feb 2026 14:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1770128306; bh=xUdVKJ+gj/1xdIblxcxTrBTv6Wrr/7pNosZpP3j5A5Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NeeYNuhTrq2XCWsk1iaPwvi3q5BvC9GcC6GoanTcj78QnGsUzlIvVYxBFonIsyUNj o3EMyWgR77BmDO0k3Vppj+WTa5M1ClXrASwM66+SLjwsreQXaVoT5JHP91QZh7qqUd GOt2Wz9y/jmcvjYG6zNo2uIfhC/NG2U7vlH2WGhXWdGrLn0tKXK5fNDxDXAlMw5FZ2 U+kZMzijtNl3+00CFmdCzneQJYEQKpwu4WQcInahjBoqR5sdhCCWJ+v1yJF25nulYP zpYESry6Yk6GBtlCoYUtSooyak9PLMjCfO2NtFIHXkKvWblhNNjUrh2+MW7cPM8obg nSiwZbPv4J2gQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 519E1180083 for ; Tue, 3 Feb 2026 14:18:21 +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=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 3 Feb 2026 14:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1770128295; bh=9WknGd45oSoIFpbrf3zrAOchAIMRtJvi9Zeqc1VMCfU=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=gf6RMDOyrcpnOoKjBa9w459qNDy5yScwAxTd9FNQmitQpeD0rKowFDMAD9hid+Z3u zy9sEaxO+WmK7dTw7t45r9YMOp0GBe132qU3sdcHKp4tqwXWQhT4MfZH/VWkIPj0oA Wmi99DJ9yiOovy83++kV5sP9uPIF4WHl3IOhJoaYPGbkeNu20GZpSzrvtrjSoRCGYy K92pBKO0s5EkZFWJYgtpR8zbdGn4lxFYg2xt+9C4AIC5+MiujUm5pnST2mSuYIffk1 ca7+f08QV53zig46fTjZEqrwX5m7d1hxbL6XAOlsXyTs/zNIGIOxGUPAFHr1RMXRtn ODhGEmE6Dv0hw== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Tue, 03 Feb 2026 15:18:14 +0100 To: Ben Ramsey Cc: internals@lists.php.net Subject: Re: [PHP-DEV] [Vote] Add form feed as a whitespace character in trim, ltrim and rtrim In-Reply-To: <20260130003750.5CA2A1A00BD@lists.php.net> References: <4deea2df.a2a0.19be6247b75.Coremail.lamentxu@163.com> <20260130003750.5CA2A1A00BD@lists.php.net> Message-ID: <886205c77a8fdf08f4ddfb28b7605e51@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2026-01-30 01:37, schrieb Ben Ramsey: > I've voted "no" on this RFC since the RFC says the proposed PHP version > is PHP 8.5, which I interpret as meaning PHP 8.6, since 8.5 was > released in November. > > Even if PHP 8.6 is the proposed version, I still think the target > version should be PHP 9.0, since this is a BC break. I mentioned my > concern about this being a BC break in the discussion thread. > > The RFC is also clear this is a BC break. It says: > >> This is a **backward incompatible change**. Scripts that rely on >> `trim()` *preserving* leading or trailing Form Feed characters will >> be affected. > > I'm a little surprised by the number of folks who voted "yes" on this, > despite it being very clear this is a BC break and PHP "Next" is the > implied proposed version. I however disagree that the target version of this RFC should be 9.0. It technically is a BC break, but so is almost anything else, including any bugfix. Our policy explicitly allows BC breaks in minor version, but gives some recommendations as to what BC breaks are acceptable: https://github.com/php/policies/blob/6ff3612f7f60e9d91188d986cfb4ca84d0722732/release-process.rst#minor-version-number While the proposed BC break would be a “silent” BC break, I believe it qualifies for the “case by case” exception, since: - It is unifying the behavior with other programming languages, including standards defining what “whitespace” means. - trim is well-understood in the community as “removing whitespace”. - Thus it not removing something that clearly is whitespace could be interpreted as a bug. - If users for some reason rely on form feed characters being preserved, I expect them to be well aware of their special requirement. - For those users, mitigating the break is possible with basic tooling, by simply searching the codebase for all occurences of `trim(` and then adjusting the calls to explicitly specify a list of characters to trim (or to replace them with a wrapper). For these reasons I don't think we should wait several years until PHP 9 to make the change. We're shipping more impactful breaking changes and bugfixes with every minor version. Best regards Tim Düsterhus