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
Check of ini_get should be keeped in mind #3382
Comments
A work around is to use a variable: https://phpstan.org/r/2ed528dc-396b-43f0-9859-1a515439cf52 |
@ondrejmirtes yeah I solved it that way. Still would be great if phpstan could handle this as I remember it in some places it also did keep values in mind. |
@alexander-schranz After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-3: Parameter #1 $path of function realpath expects string, string|false given.
+No errors |
Fixed: phpstan/phpstan-src@d4edc59 |
Closes phpstan/phpstan#4588 Closes phpstan/phpstan#4091 Closes phpstan/phpstan#3382 Closes phpstan/phpstan#4177 Closes phpstan/phpstan#2288 Closes phpstan/phpstan#1157
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
If you check for
ini_get
in inside an if statement like here in symfony and access it later the check before is not kept in mind and so phpstan will fail.Code snippet that reproduces the problem
https://phpstan.org/r/57150eac-dde7-4f08-b05d-549720c8e5ea
Expected output
No Errors
The text was updated successfully, but these errors were encountered: