You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue which came up with Version 1.8.1 which was not present in 1.8.0.
The code below is shown as if it contains issues but from my point of view it is more like a false positive since the iteration can and will change the values in $arr.
Instead of a const array we are retrieving objects from the database which can also have a collection of objects which is stored within the $arr variable and therefore can have duplicates which are filtered away in this structure.
Bug report
There is an issue which came up with Version 1.8.1 which was not present in 1.8.0.
The code below is shown as if it contains issues but from my point of view it is more like a false positive since the iteration can and will change the values in
$arr
.Instead of a const array we are retrieving objects from the database which can also have a collection of objects which is stored within the
$arr
variable and therefore can have duplicates which are filtered away in this structure.Code snippet that reproduces the problem
On phpstan.org
Expected output
Should not report an error, since the
$arr
variable is only empty in the first iteration.The text was updated successfully, but these errors were encountered: