Skip to content

4.0 | Generic.Functions.CallTimePassByReference: remove sniff #921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rodrigoprimo opened this issue Apr 2, 2025 · 1 comment
Closed

Comments

@rodrigoprimo
Copy link
Contributor

Description

I suggest marking the Generic.Functions.CallTimePassByReference sniff as deprecated in the next minor version and removing it in 4.0.

Call-time pass-by-reference was deprecated in PHP 5.3 and removed in PHP 5.4.

PHPCS 3.x supports PHP >= 5.4. PHPCS 4.0 will drop support for PHP < 7.2.

There is a PHPCompatibility sniff to check for the use of call-time pass-by-reference: PHPCompatibility.Syntax.ForbiddenCallTimePassByReference.

@jrfnl
Copy link
Member

jrfnl commented Apr 2, 2025

The PHP version PHPCS supports is not relevant to the decision.

Having said that, I don't disagree with deprecating and removing the sniff. The sniff has always been a bit of an odd-one out between the sniffs in this package and I agree that PHPCompatibility would be the better tool to check for deprecated PHP syntax.

As PHP 5.4 was released in 2012, with the last security release in 2015, I can't imagine this sniff is still used much, so I think deprecating the sniff and removing it in 4.0 makes sense.

Action list:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants