Skip to content

Wrong type assumptions #5172

@jrmajor

Description

@jrmajor

Bug report

Code snippet that reproduces the problem

https://phpstan.org/r/c9afcc1a-1d8b-48d6-aaf8-8ae3dead2e03

Expected output

Dumped type in lines 21/22 is mixed~null, which is a wrong assumption (in case I pointed out in a comment).

Also, the message Using nullsafe property access on non-nullable type mixed. Use -> instead. makes no sense, because mixed is a nullable type.

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

PHPStan makes me happier every day!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions