Skip to content

DateInterval with int operation causes an error #1452

@roukmoute

Description

@roukmoute

Summary of a problem or a feature request

Binary operation "*" between string and 60 results in an error.

Code snippet that reproduces the problem

https://phpstan.org/r/6581c3e53b34d9c6b26bc6fe21051afd

Expected output

No Error

I know I can force typehinting for the left part, but I don't think it's a good thing due to infection because it removes this useless cast and I can't validate in my test this cast.

Do you have any idea to resolve that?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions