We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
scalar|array|object|resource|null
MixedAssignment
InvalidCast
scalar|array|object|null
mixed
<?php $a = []; echo (string) $a; /** * @var mixed */ $b = []; echo (string) $b; /** * @var scalar|array|object|resource|null */ $c = []; echo (string) $c; /** * @var scalar|array|object|null */ $d = []; echo (string) $d;
Psalm output (using commit 119687f): ERROR: InvalidCast - 4:6 - array<empty, empty> cannot be cast to string INFO: MixedAssignment - 9:1 - Cannot assign $b to a mixed type ERROR: InvalidCast - 25:6 - array<array-key, mixed>|scalar|object|null cannot be cast to string
Psalm output (using commit 119687f):
ERROR: InvalidCast - 4:6 - array<empty, empty> cannot be cast to string
INFO: MixedAssignment - 9:1 - Cannot assign $b to a mixed type
ERROR: InvalidCast - 25:6 - array<array-key, mixed>|scalar|object|null cannot be cast to string
The text was updated successfully, but these errors were encountered:
It's really just a failure of
/** * @var array|resource */ $c = []; echo (string) $c;
to emit an error
Sorry, something went wrong.
d1cf9d6
No branches or pull requests
issue
scalar|array|object|resource|null
does not flag upMixedAssignment
(could go either way on this one)behaves as expected
InvalidCast
scalar|array|object|null
does flag upInvalidCast
does not behave as expected
InvalidCast
scalar|array|object|resource|null
(akamixed
) does not flag upInvalidCast
repro
The text was updated successfully, but these errors were encountered: