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.

Hi Juliette,

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.

> == 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.

Kind regards,
Theodore

Reply via email to