vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.55k stars 659 forks source link

Array reference doesn't expand type #10105

Open bugreportuser opened 1 year ago

bugreportuser commented 1 year ago

When an array element is passed by reference, its type is not expanded, which causes some assertions to be inaccurate.

Example: https://psalm.dev/r/137ffbc3fa

The DocblockTypeContradiction issue is misleading. When the code is run, it has the following output:

int(0)
psalm-github-bot[bot] commented 1 year ago

I found these snippets:

https://psalm.dev/r/137ffbc3fa ```php