Skip to content

Bogus error when using empty in combination with ArrayObject #10783

Description

@colorvamp

Bug report

https://phpstan.org/r/26a6a63c-d15b-4e51-b4b5-17ae50979c58

When you generate an array from ArrayObject->getArrayCopy() phpstan is unable to identify emptyness

Expression in empty() is always falsy.

Code snippet that reproduces the problem

https://phpstan.org/r/26a6a63c-d15b-4e51-b4b5-17ae50979c58

Expected output

No errors

Did PHPStan help you today? Did it make you happy in any way?

👍

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions