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

get_defined_vars() doesn't make function arguments considered used #10865

Closed
hocker1 opened this issue Apr 11, 2024 · 2 comments
Closed

get_defined_vars() doesn't make function arguments considered used #10865

hocker1 opened this issue Apr 11, 2024 · 2 comments
Labels
Milestone

Comments

@hocker1
Copy link

hocker1 commented Apr 11, 2024

Bug report

PHP function get_defined_vars() creates array of all currently visible variables (name => value), including function arguments. PHPStan probably doesn't mark arguments as used after calling get_defined_vars(). Similar function - func_get_args() correctly marks arguments as used.

Code snippet that reproduces the problem

https://phpstan.org/r/5a1cab33-f3ff-4b26-ba76-c7bc7feaa235

Expected output

PHPStan reported issue, which is (in my opinion) not an issue.

Did PHPStan help you today? Did it make you happy in any way?

No response

@ondrejmirtes
Copy link
Member

Fixed phpstan/phpstan-src#3012

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants