-
-
Notifications
You must be signed in to change notification settings - Fork 864
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
Cannot use lexical variable #1855
Labels
Comments
also tracking in psalm on vimeo/psalm#1256 |
Thanks. Adding this as another thing that should be detected: |
@ondrejmirtes After the latest push in 1.11.x, PHPStan now reports different result with your code snippet: @@ @@
-No errors
+5: Redefinition of parameter $foo. Full report
|
Implemented: phpstan/phpstan-src#2755 |
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
using whichever version is on the PHPStan playground at the time of writing
Summary of a problem or a feature request
Under php 7.0, variable/param name collisions seem to be silently ignored, but under php 7.1 onwards it's identified as a fatal error.
Code snippet that reproduces the problem
"Cannot use lexical variable $foo as a parameter name"
Expected output
An error similar to that which occurs with an "unused use", e.g. https://phpstan.org/r/cff41209-747e-414d-8ef3-60fa360f5bfd
The text was updated successfully, but these errors were encountered: