Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128414 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 490FC1A00BC for ; Wed, 6 Aug 2025 23:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1754521607; bh=Yaoc/UhJp26NNP2a3ZPGCKyEtj7UnmZkdEnqZDjN8ng=; h=Subject:To:References:From:Date:In-Reply-To:From; b=fIX0zpchoaZjLDEozBq8oVINE2mjYR6ppGe6vb5r2Ekz74Gp30c3qL2hSFQl9DlR0 cb3Gl2L7tG6M8WwPhHBiWRgyGUzJmDKpY9g9R3k6+o3scBakSECUyubBe/OBJR007Z CpxzxwrgPgstw5COiIuPUyXHk8cMP3YMRYkBWcesaj24VLQOiPDp/qD0B5gO+D/gjQ eJ4DbhI3uJwZuZxlNVANSYhACAYAwTfh9+B+03/5TnNyqf3vXEC0HJXMH4LwW6o6kK uBTwaDFYbQwDDWUn3pdy11LkZ9RYbSCqM3PrcNBOIpDV1LkbEN2H5xxcY74BOdJG74 8j9t/9/IFiBUg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0CDBF180059 for ; Wed, 6 Aug 2025 23:06:46 +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=1.5 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, HTML_MESSAGE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from common.ash.relay.mailchannels.net (common.ash.relay.mailchannels.net [23.83.222.38]) (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, 6 Aug 2025 23:06:45 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CCC334E6508 for ; Wed, 6 Aug 2025 23:08:23 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (trex-blue-8.trex.outbound.svc.cluster.local [100.96.9.184]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 4438A4E606E for ; Wed, 6 Aug 2025 23:08:22 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1754521702; a=rsa-sha256; cv=none; b=e3HowrTRdrPY750tFuEt5gkgsP7T/r/4SL5V29k1cboS5cAi226+JOZLntOX8Gk/GlRPqc BS4SFvETPmGO6o+zIZbW/pSXUKtZUOf+zSYfsuFxcQfjWpv2jvP0Z4pc0LB5o6vsqVQzVy 7yT3tnsZQI3EfmVaDHEWgkLRxvht9ofEpOxD+Lv62a0XIvElSVribvkFbwuDV7hVP0RY84 VnPqJi8uVm4gNF4KkU8AWDjziUbbHJzHWC/AFO5/QyulRlMgaBQ4TU9aOnLs4nGskbj0d3 4uN5HioDMDJkbqdtnSZF2Zqy4DTqlD4tujKLnJl/qi0nh5bE9XMQCfOigT5wGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1754521702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=duSXxPNGeyfV1IFRZ+hl93QOTqKKz2SiioRKg/r9sbs=; b=894DZtFzJI5Ou40wBJMZZWvKyMCaH7yqscMgVwRMft7mIgm+eBnhNFZ992JhBwwdUnuaeX NGGtraR0O/5va4dhhfT+DBrJHsjvbhE126LEZq8CmHCJG7XRwc0LZGUsJg4e+PYBgpETvV 8plNLfknX2Nb7kbk3p+pdUzHpic9QJdfqzIrxCqrzZTHMIPfNXb/pdCvoSqsN4cV46uF2z BTAImiOAcorJI0gXtmsf4RmU9WlBWf/hRoRONmz5lfHkMdpYM7U9xxNEUZNpxMmPloa294 4S6+ufFoONX7iExOdqhvf2eCuX62MNoiWrWeGbxlfo0dHNljes7tM1pxu1a5Ag== ARC-Authentication-Results: i=1; rspamd-565df7d78-fd86r; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Society-Army: 731b570c2a573851_1754521702812_721057228 X-MC-Loop-Signature: 1754521702812:3987439576 X-MC-Ingress-Time: 1754521702811 Received: from nl1-ss105.a2hosting.com (nl1-ss105.a2hosting.com [85.187.142.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.9.184 (trex/7.1.3); Wed, 06 Aug 2025 23:08:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=duSXxPNGeyfV1IFRZ+hl93QOTqKKz2SiioRKg/r9sbs=; b=WkXW17Yn2ppSH+GRz/en42uDiG fDo72RLpiampnggbKmk+fMwlY2HaunW3Fgw7rGpaJ9AQG/dNFOPLT5B81Abl+OAPnsEuZtq6DsaAA a190UoKmY6kQ8J1D/tvxUQV99qPZxpMiaLpyjTLLfgUkeBkg61Dg+XoBfyxF1mYp2Epg=; Received: from mailnull by nl1-ss105.a2hosting.com with spam-scanner (Exim 4.98.2) (envelope-from ) id 1ujnF6-00000003qh5-21e4 for internals@lists.php.net; Thu, 07 Aug 2025 01:08:20 +0200 X-ImunifyEmail-Filter-Score: -3.57 X-ImunifyEmail-Filter-Version: 3.8.16/202508050747 X-ImunifyEmail-Filter-Action: no action X-ImunifyEmail-Filter-Info: UkNWRF9DT1VOVF9PTkUgSUVfVkxfUEJMX0FDQ09VTlRfMDEg QkFZRVN fSEFNIFZFUklMT0NLX0NCIFJDVkRfVExTX0FMTCBNSURfUkhTX01BVE NIX0ZST00gUkNWRF9WSUFfU01UUF9BVVRIIEZST01fSEFTX0ROIFRPX 0ROX1NPTUUgTUlNRV9UUkFDRSBUT19ETl9FUV9BRERSX1NPTUUgRlJP TV9FUV9FTlZGUk9NIFRPX01BVENIX0VOVlJDUFRfU09NRSBSQ1BUX0N PVU5UX1RXTyBBUkNfTkEgQVNOIE1JTUVfVU5LTk9XTg== Received: from [31.201.40.213] (port=52798 helo=[192.168.1.16]) by nl1-ss105.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1ujnF7-00000003qTA-28eg; Thu, 07 Aug 2025 01:08:20 +0200 Subject: Re: [PHP-DEV] [RFC] Deprecations for PHP 8.5 To: Theodore Brown , "internals@lists.php.net" References: <68830C4F.5020107@adviesenzo.nl> Message-ID: <6893E062.2070709@adviesenzo.nl> Date: Thu, 7 Aug 2025 01:08:18 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------070804010002030800000102" X-AuthUser: juliette@adviesenzo.nl From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) This is a multi-part message in MIME format. --------------070804010002030800000102 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 6-8-2025 6:21, Theodore Brown wrote: > On Thu, July 24, 2025 at 22:47 Juliette Folmer wrote: > >>> On 2-7-2025 21:56, G. P. Banyard wrote: >>> >>> It is this time of year again where we proposed a list of deprecations to add in PHP 8.5: >>> >>> https://wiki.php.net/rfc/deprecations_php_8_5 >> >> Just leaving a note here that I find it inconceivable that the fast majority of proposed >> deprecation (again) do NOT have an impact analysis. >> >> I've spoken up about this before and will continue to do this as it basically means >> a "blind vote", where voters can only rely on their own experience to gauge the impact >> and I expect the majority of voters to predominantly work on code which already follows >> a lot of best practices, which skews the vote towards deprecation, disregarding the real >> world impact on less clean codebases. > I just analyzed the top 1500 Composer packages for a couple more of the proposed syntax > deprecations, and found the following: > > ## Deprecate non-standard cast names: > 197 non-standard casts in 25 unique packages. > > ## Deprecate backticks as an alias for shell_exec: > 49 backtick operator executions in 10 unique packages. > > I find it ironic that the more widely used of these proposals has the least opposition to > deprecate (100% in favor so far), while deprecating semicolon-terminated case statements > (which has zero usages in the top 1500 packages) currently has more opposition than either > of these. Hi Theodore, Thank you for making the effort to gather more impact analysis. I wish this kind of information would be mandatory for all deprecations and I appreciate your efforts to help gather the info, though considering the timing, it probably won't have any impact on the vote anymore. I'm not surprised at all by the 0 usage of the semicolon-terminated case statements in the top 1500 packages as it is forbidden by PSR2 and a significant number of the top 1500 packages use PSR2/12/PER. In contrast, PSR2/12/PER does not have any rules about the use of non-standard cast names or the use of the backtick operator. I also imagine if impact analysis would be done on, let's say package 20.000 to 22.000, instead of the top 1500 (or on both), results may be interestingly different. > >> == Deprecate semicolon after case in switch statement == >> >> Opinion: Feels like an unnecessary deprecation. >> >> Side-note: The deprecation is also already flagged by PHPCS and will be auto-fixable >> as of PHP_CodeSniffer 3.13.3 (via the PSR2.ControlStructures.SwitchDeclaration sniff). > Perhaps the deprecation seems unnecessary at first, but there is a non-zero cost to > maintaining this legacy alternate syntax in the language: > > 1. It requires projects and coding style guides to choose and document which syntax to use. > 2. Coding style fixers like PHP-CS-Fixer and PHPCS have to implement and maintain fixers > to enforce one of the syntaxes. > 3. Who knows whether the alternate syntax may block future proposals, as was the case for > the curly brace array/string offset syntax, which being deprecated in PHP 7.4 made it > possible to implement property hooks in PHP 8.4. I don't think this reasoning is valid. Code style tools which have support for scanning code against PSR2 already handle this and have for a long time. There is no significant maintenance costs to that anymore. The costs is in the past. More than anything, even when the syntax would be deprecated and eventually removed, these tools will still need to keep up support for flagging these things as these tools are often enough used on older code bases, which haven't been updated for the deprecation yet. The deprecation and eventual removal will more likely increase maintenance costs for these tools, as contributors less versed in the intricacies of PHP will try to remove support or flag the test code used as a parse error, which then means a maintainer will have to explain this used to be supported by PHP etc etc. It also means more detection tooling needs to be created - like in PHPCompatibility - to detect this for years to come. So no, in my estimation, deprecating this syntax will create more work, not less work for code style fixing libraries and adjacent projects. Smile, Juliette --------------070804010002030800000102 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit On 6-8-2025 6:21, Theodore Brown wrote:
On Thu, July 24, 2025 at 22:47 Juliette Folmer wrote:

On 2-7-2025 21:56, G. P. Banyard wrote:

It is this time of year again where we proposed a list of deprecations to add in PHP 8.5:

https://wiki.php.net/rfc/deprecations_php_8_5

Just leaving a note here that I find it inconceivable that the fast majority of proposed
deprecation (again) do NOT have an impact analysis.

I've spoken up about this before and will continue to do this as it basically means
a "blind vote", where voters can only rely on their own experience to gauge the impact
and I expect the majority of voters to predominantly work on code which already follows
a lot of best practices, which skews the vote towards deprecation, disregarding the real
world impact on less clean codebases.
I just analyzed the top 1500 Composer packages for a couple more of the proposed syntax
deprecations, and found the following:

## Deprecate non-standard cast names:
197 non-standard casts in 25 unique packages.

## Deprecate backticks as an alias for shell_exec:
49 backtick operator executions in 10 unique packages.

I find it ironic that the more widely used of these proposals has the least opposition to
deprecate (100% in favor so far), while deprecating semicolon-terminated case statements
(which has zero usages in the top 1500 packages) currently has more opposition than either
of these.

Hi Theodore,

Thank you for making the effort to gather more impact analysis. I wish this kind of information would be mandatory for all deprecations and I appreciate your efforts to help gather the info, though considering the timing, it probably won't have any impact on the vote anymore.

I'm not surprised at all by the 0 usage of the semicolon-terminated case statements in the top 1500 packages as it is forbidden by PSR2 and a significant number of the top 1500 packages use PSR2/12/PER.
In contrast, PSR2/12/PER does not have any rules about the use of non-standard cast names or the use of the backtick operator.

I also imagine if impact analysis would be done on, let's say package 20.000 to 22.000, instead of the top 1500 (or on both), results may be interestingly different.


== Deprecate semicolon after case in switch statement ==

Opinion: Feels like an unnecessary deprecation.

Side-note: The deprecation is also already flagged by PHPCS and will be auto-fixable
as of PHP_CodeSniffer 3.13.3 (via the PSR2.ControlStructures.SwitchDeclaration sniff).
Perhaps the deprecation seems unnecessary at first, but there is a non-zero cost to
maintaining this legacy alternate syntax in the language:

1. It requires projects and coding style guides to choose and document which syntax to use.
2. Coding style fixers like PHP-CS-Fixer and PHPCS have to implement and maintain fixers
to enforce one of the syntaxes.
3. Who knows whether the alternate syntax may block future proposals, as was the case for
the curly brace array/string offset syntax, which being deprecated in PHP 7.4 made it
possible to implement property hooks in PHP 8.4.

I don't think this reasoning is valid. Code style tools which have support for scanning code against PSR2 already handle this and have for a long time. There is no significant maintenance costs to that anymore. The costs is in the past.
More than anything, even when the syntax would be deprecated and eventually removed, these tools will still need to keep up support for flagging these things as these tools are often enough used on older code bases, which haven't been updated for the deprecation yet.
The deprecation and eventual removal will more likely increase maintenance costs for these tools, as contributors less versed in the intricacies of PHP will try to remove support or flag the test code used as a parse error, which then means a maintainer will have to explain this used to be supported by PHP etc etc.
It also means more detection tooling needs to be created - like in PHPCompatibility - to detect this for years to come.

So no, in my estimation, deprecating this syntax will create more work, not less work for code style fixing libraries and adjacent projects.

Smile,
Juliette



--------------070804010002030800000102--