-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#140Labels
Milestone
Description
https://phpstan.org/r/62477238-a0bd-4fca-95fb-e4d9b1f36422
<?php declare(strict_types = 1);
class HelloWorld
{
public function sayHello(): void
{
$a = mt_rand();
if ($a === 0) {return;}
// this shoud reset $a range
$a--;
// bug: Strict comparison using === between int<1, max>|int<min, -1> and 0 will always evaluate to false.
if ($a === 0) {return;}
}
}PHPStan should reset int range after $a-- call. Same for $a++.
Reactions are currently unavailable