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

@var is ignored #5086

Closed
mvorisek opened this issue May 27, 2021 · 6 comments
Closed

@var is ignored #5086

mvorisek opened this issue May 27, 2021 · 6 comments

Comments

@mvorisek
Copy link
Contributor

mvorisek commented May 27, 2021

Bug report

Code snippet that reproduces the problem

https://phpstan.org/r/cc2903e8-035e-4331-b4ba-9cd53ccf58b2

Expected output

stdClass dumped type

@ondrejmirtes
Copy link
Member

This is a better alternative: https://phpstan.org/r/7c339062-4896-44cf-920f-fac8a3272355

@phpstan-bot
Copy link
Contributor

@mvorisek After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-10: Dumped type: mixed~0|0.0|''|'0'|array()|false|null
+10: Dumped type: mixed~0|0.0|''|'0'|array{}|false|null
Full report
Line Error
10 `Dumped type: mixed~0

@phpstan-bot
Copy link
Contributor

@mvorisek After the latest push in 1.10.x, PHPStan now reports different result with your code snippet:

@@ @@
-10: Dumped type: mixed~0|0.0|''|'0'|array()|false|null
+ 3: Tip: Function xx() always throws an exception, it should have return type "never".
+10: Dumped type: mixed~0|0.0|''|'0'|array{}|false|null
Full report
Line Error
3 Tip: Function xx() always throws an exception, it should have return type "never".
10 `Dumped type: mixed~0

@phpstan-bot
Copy link
Contributor

@ondrejmirtes After the latest push in 1.10.x, PHPStan now reports different result with your code snippet:

@@ @@
+ 3: Tip: Function xx() always throws an exception, it should have return type "never".
  7: Negated boolean expression is always false.
 11: Dumped type: stdClass
Full report
Line Error
3 Tip: Function xx() always throws an exception, it should have return type "never".
7 Negated boolean expression is always false.
11 Dumped type: stdClass

@phpstan phpstan deleted a comment from phpstan-bot Apr 13, 2023
@phpstan phpstan deleted a comment from phpstan-bot Apr 13, 2023
@phpstan-bot
Copy link
Contributor

@mvorisek After the latest push in 1.11.x, PHPStan now reports different result with your code snippet:

@@ @@
-10: Dumped type: object
+10: Dumped type: stdClass
Full report
Line Error
10 Dumped type: stdClass

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 Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants