Skip to content

Incorrect type with empty check #14097

@earthiverse

Description

@earthiverse

Bug report

In the code snippet, if the object is created with the spread operator, it has the incorrect type for the arguments

Code snippet that reproduces the problem

https://phpstan.org/r/0852c0d5-dd31-45a6-bcfc-c9cb98712821

Expected output

It should be int|null, because of the cast to int. Unsure where the string type is coming from, and why null is no longer possible.

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

It helps me 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