Skip to content

less precise type when strict-types=1 after assign #12902

Description

@staabm

Bug report

with strict-types=0
https://phpstan.org/r/a05146b2-c2bb-4a10-94f4-6c280e8b75ca

we see a more precise type as in comparison to strict-types=1
https://phpstan.org/r/cea4a4f4-c995-4fae-afa1-d24fce45cdb0

Code snippet that reproduces the problem

https://phpstan.org/r/cea4a4f4-c995-4fae-afa1-d24fce45cdb0

Expected output

no error - with strict-types=1 we should have at least same precision of types, but not less precise as with strict-types=0

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

No response

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions