Skip to content

Casting to int something that's already an int, while the value may not be an int #1251

@arnaud-lb

Description

@arnaud-lb

Summary of a problem or a feature request

Sometimes, PHPStan thinks that a value is an int, while it may not be

Code snippet that reproduces the problem

https://phpstan.org/r/ed0174a21527bd88cd51843f1f919fb7

Expected output

PHPStan should not emit a warning here

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