Skip to content

rand() values are ignored #7547

@ghost

Description

Bug report

PHPStan does not detect the parameter values passed to the rand() function. In my example snippet, you can see how it fails to understand that the input is always set, because the input values are either 1 or 2.

Code snippet that reproduces the problem

https://phpstan.org/r/0a3522ab-1db0-4fe5-96af-bec1b3a60ee1

Expected output

No error

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

PHPStan is awesome, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions