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
If you call count on a SplObjectStorage before calling SplObjectStorage::removeAll then on subsequent if (count() === 0) calls PHPStan report an error that this check will always be false. Calling removeAllmight change the contents. Same problem with removeAllExcept calls.
Strict comparison using === between int<1, max> and 0 will always evaluate to false.
Bug report
If you call
count
on aSplObjectStorage
before callingSplObjectStorage::removeAll
then on subsequentif (count() === 0)
calls PHPStan report an error that this check will always be false. CallingremoveAll
might change the contents. Same problem withremoveAllExcept
calls.Code snippet that reproduces the problem
https://phpstan.org/r/69cf4869-d279-4876-977c-468f3f5d94a9
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
PHPStan helps me alot and makes me happy. :-)
The text was updated successfully, but these errors were encountered: