Skip to content
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

Report unused variable for non-by-ref use #4547

Closed
muglug opened this issue Nov 13, 2020 · 1 comment
Closed

Report unused variable for non-by-ref use #4547

muglug opened this issue Nov 13, 2020 · 1 comment

Comments

@muglug
Copy link
Collaborator

muglug commented Nov 13, 2020

<?php

$data = [];

return function () use ($data) {
    $data[] = 1;
};

https://psalm.dev/r/9a4fc7e7e6

@psalm-github-bot
Copy link

psalm-github-bot bot commented Nov 13, 2020

I found these snippets:

https://psalm.dev/r/9a4fc7e7e6
<?php

$data = [];

return function () use ($data) {
    $data[] = 1;
};
Psalm output (using commit 086237a):

No issues!

@muglug muglug closed this as completed in 2e47ca5 Nov 13, 2020
danog pushed a commit to danog/psalm that referenced this issue Jan 29, 2021
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

1 participant