Skip to content

Bogus error in for-loop (difficult to explain) #7044

@dktapps

Description

@dktapps

Bug report

The below error was discovered during PocketMine-MP development. When LOWER_PADDING_SIZE has a value of 4, everything is OK. However, when reducing it to zero, for some reason PHPStan thinks that I'm incrementing a string, which makes no sense.

I may have previously reported this, but if I did I couldn't find a similar issue.

Code snippet that reproduces the problem

https://phpstan.org/r/cdc088cd-8927-40ed-8fc5-f41112192430

Expected output

The bogus error shouldn't be reported.

Possibly, an error should be reported about the loop never looping, but that seems like a topic for a feature request and not a bug report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions