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
Bogus error when assigning to offset of ArrayObject<array<something>> #6398
Comments
@dktapps After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-PHP 7.2 – 8.1 (1 error)
+PHP 7.2 – 8.1 (2 errors)
==========
+14: Static property AsyncTask::$threadLocalStorage (ArrayObject<int, array<string, mixed>>|null) does not accept ArrayObject<(int|string), mixed>.
16: Static property AsyncTask::$threadLocalStorage (ArrayObject<int, array<string, mixed>>|null) does not accept non-empty-array<int, non-empty-array<string, mixed>>|ArrayObject<int, array<string, mixed>>.
-PHP 7.1 (3 errors)
+PHP 7.1 (4 errors)
==========
+14: Static property AsyncTask::$threadLocalStorage (ArrayObject<int, array<string, mixed>>|null) does not accept ArrayObject<(int|string), mixed>.
16: Function spl_object_id not found.
16: Static property AsyncTask::$threadLocalStorage (ArrayObject<int, array<string, mixed>>|null) does not accept non-empty-array<int|string, non-empty-array<string, mixed>>|ArrayObject<int, array<string, mixed>>.
23: Function spl_object_id not found. Full reportPHP 7.2 – 8.1 (2 errors)
PHP 7.1 (4 errors)
|
welp |
Relaxed it a bit: phpstan/phpstan-src@089d4c6 |
why is that change exclusive to bleeding-edge? |
Because it's a new and stricter behaviour that will be enabled for everyone in PHPStan 2.0. |
Another example https://phpstan.org/r/10bc4ea9-fe30-4211-9d2b-52dc7fef4dee |
@dktapps After the latest push in 1.11.x, PHPStan now reports different result with your code snippet: @@ @@
-PHP 7.2 – 8.1 (1 error)
-==========
-
-16: Static property AsyncTask::$threadLocalStorage (ArrayObject<int, array<string, mixed>>|null) does not accept non-empty-array<int, non-empty-array<string, mixed>>|ArrayObject<int, array<string, mixed>>.
-
-PHP 7.1 (3 errors)
-==========
-
-16: Function spl_object_id not found.
-16: Static property AsyncTask::$threadLocalStorage (ArrayObject<int, array<string, mixed>>|null) does not accept non-empty-array<int|string, non-empty-array<string, mixed>>|ArrayObject<int, array<string, mixed>>.
-23: Function spl_object_id not found.
+16: Static property AsyncTask::$threadLocalStorage (ArrayObject<int, array<string, mixed>>|null) does not accept non-empty-array<int, non-empty-array<string, mixed>>|ArrayObject<int, array<string, mixed>>. Full report
|
Bug report
Code snippet that reproduces the problem
https://phpstan.org/r/fbafd268-227e-401e-9a26-47fcc9d8541f
Expected output
No error should be reported.
The text was updated successfully, but these errors were encountered: