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
Quoting an int does not make phpstan know that it is now a string - 1.9.5 #8635
Comments
This bug report is missing a link to reproduction at phpstan.org/try. It will most likely be closed after manual review. |
I really need the reproduction on phpstan.org/try, thanks. |
|
Fixed: phpstan/phpstan-src@dc77608 |
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. |
Bug report
Code snippet that reproduces the problem
Expected output
Passes -
GenerateNewAuthUserAccessToken
expects a string in parameter1Actual output
With phpstan 1.9.4 this sort of code passes. The idiom
"$intVariable"
was analyzed OK.$intVariable
is anint
type, and the result of quoting it makes it into astring
type, and satisfies a function call that requires a string parameter.But with phpstan 1.9.5 it still thinks that the quoted string is an int, and complains about it.
a) Original code:
b) If I do this, it still thinks that I am passing an int:
c) If I explicitly cast to string, then it is happy:
Making the code-change at (c) is fine. I am just raising this issue so that there is awareness that the phpstan behavior changed. Feel free to close if you think that the new behavior is correct/acceptable.
The text was updated successfully, but these errors were encountered: