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
phpstan assumes _SESSION always exists #4586
Comments
This fix is probably wrong. phpstan/phpstan-src#321 |
For some reason the inverse does not trigger any error: https://phpstan.org/r/65dbfe18-b20e-4655-a280-935f5089d1f3 |
@staabm After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-10: Unreachable statement - code above always terminates.
+ 5: Method HelloWorld::sayHello() should return bool but return statement is missing. Full report
|
@sjerdo After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-No errors
+5: Method HelloWorld::sayHello() should return bool but return statement is missing. Full report
|
@staabm After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-10: Unreachable statement - code above always terminates.
+No errors |
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
I dont expect the error we get at https://phpstan.org/r/34e05837-1aa9-41f2-8a74-0d3b30f7f54d
since the super global
$_SESSION
is only defined aftersession_start()
is calledsee https://3v4l.org/0a8Ie vs. https://3v4l.org/GlBZ2
Expected output
no error
The text was updated successfully, but these errors were encountered: