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
{{ message }}
Repository navigation
False positive about empty array with foreach loop #15147
Yes, the knowledge what $alias is should definitely update after $this->populate($alias); Because it's an object passed by reference and this usually works fine in PHPStan (at least it invalidates remembered method calls on the object, but probably doesn't change the generics).
Generics should change probably only if the initial object is empty (has NeverType templates). Otherwise it could lead to some unsound code.
Activity
ondrejmirtes commentedon Sep 1, 2026
Yes, the knowledge what
$aliasis should definitely update after$this->populate($alias);Because it's an object passed by reference and this usually works fine in PHPStan (at least it invalidates remembered method calls on the object, but probably doesn't change the generics).Generics should change probably only if the initial object is empty (has NeverType templates). Otherwise it could lead to some unsound code.
Cleanup some phpstan-ignore directive (some waiting for bug fixed in …
Add regression test for #15147
Add regression test for #15147
Updated PHPStan to commit 3bc4b93d66c402b85a65111fdf572db5daf599ed
franck-paul commentedon Oct 27, 2026
Is the Playground using the last release or "last-dev-commit" of PHPStan?
As in my example (https://phpstan.org/r/45eca57f-0a03-493a-984e-bf4c7ec33584) I still have the error.
staabm commentedon Oct 27, 2026
the improved behaviour (the fixed bug) is only visible with enabled bleeding-edge for now: https://phpstan.org/r/42c879e8-2a76-4737-8395-ff78a3d9e441