Skip to content

Comparison operation "<" between int<min, X> and Y is always true. in for loop #3264

@mehdibo

Description

@mehdibo

Bug report

When using 2 for loops, PHPStan reports:

Comparison operation "<" between int<min, 13> and 40 is always true.

In the snippet, it works fine with $predefinedShops = 1,
but starts bugging from $predefinedShops = 2

Code snippet that reproduces the problem

https://phpstan.org/r/2eda8bb9-48f7-4dbe-8a73-4bc32d9806d6

Expected output

No errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions