WordPress-Extra: remove the Generic.Functions.CallTimePassByReference sniff#2536
Merged
GaryJones merged 1 commit intoWordPress:developfrom Jun 24, 2025
Conversation
…e` sniff The `Generic.Functions.CallTimePassByReference` sniff was deprecated in PHPCS 3.13.0 and will be removed in PHPCS 4.0 (PHPCSStandards/PHP_CodeSniffer#921). Removing this sniff from WordPress-Extra will be necessary anyway when preparing this repository for PHPCS 4.0, and I believe it is something that can be done now as call-time pass-by-reference was deprecated in PHP 5.3 (https://web.archive.org/web/20150920055013/http://us1.php.net/manual/en/migration53.deprecated.php) and removed in PHP 5.4 (https://web.archive.org/web/20140815142840/http://us2.php.net/manual/en/migration54.incompatible.php). PHP 5.4 was released in 2012, with the last security release in 2015. So it is unlikely users are still relying on it, and even if they are, there is a PHPCompatibility sniff to check for the use of call-time pass-by-reference: PHPCompatibility.Syntax.ForbiddenCallTimePassByReference (https://github.com/PHPCompatibility/PHPCompatibility/blob/9013cd039fe5740953f9fdeebd19d901b80e26f2/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php#L128). This sniff was added to WordPress-Extra via WordPress#382 back in 2015.
jrfnl
approved these changes
Jun 23, 2025
Member
jrfnl
left a comment
There was a problem hiding this comment.
LGTM. Thanks @rodrigoprimo !
Regarding whether this can go in a minor or MUST go into a major: I consider this a ruleset update, not a (code) "Removal" which MUST go into a major per SemVer, so I think we should be okay to include this change in a minor release.
dingo-d
approved these changes
Jun 24, 2025
GaryJones
approved these changes
Jun 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Generic.Functions.CallTimePassByReferencesniff was deprecated in PHPCS 3.13.0, and will be removed in PHPCS 4.0.In this PR, I suggested that we remove it from WPCS. Removing this sniff from WordPress-Extra will be necessary anyway when preparing this repository for PHPCS 4.0, and I believe it is something that can be done now as call-time pass-by-reference was deprecated in PHP 5.3 and removed in PHP 5.4.
PHP 5.4 was released in 2012, with the last security release in 2015. So it is unlikely users are still relying on it, and even if they are, there is a PHPCompatibility sniff to check for the use of call-time pass-by-reference: PHPCompatibility.Syntax.ForbiddenCallTimePassByReference.
This sniff was added to WordPress-Extra via #382 back in 2015.
Closes #2528