-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
False positive unused variable when that variable is a reference #927
Labels
Milestone
Comments
@arichard4 Thanks for the report. Are you able to provide a PR (with a solution or only with a failing test?) That can help in solving this 😃 |
arichard4
added a commit
to arichard4/phpmd
that referenced
this issue
Apr 17, 2022
I submitted a PR with a failing test. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current Behavior
PHPMD doesn't seem to have special handling for variables that are references (though it does seem to handle reference parameters correctly).
However, $b is used.
#720 seems relevant but distinct.
Here's a less simplified example demonstrating why someone might use this:
PHPMD warns about ClearCache. (Curiously, it doesn't warn about InsertToCache- testing elsewhere, it seems like an array insertion is considered using a variable?)
The text was updated successfully, but these errors were encountered: