-
-
Notifications
You must be signed in to change notification settings - Fork 933
Closed
Labels
Milestone
Description
Bug report
Given I'm using an array shape like array{bool, bool, bool}, it expects a key of int<min, 2>, where I would think it should be int<min, 3> or make it inclusive?
Code snippet that reproduces the problem
https://phpstan.org/r/eaaf2943-60db-49fa-9336-a2dead66c788
<?php declare(strict_types = 1);
class HelloWorld
{
/** @var array{bool, bool, bool} */
private $tuple;
public function main(): void
{
$this->tuple = [true, true, true];
for ($i = 0; $i < 3; ++$i)
{
$this->tuple[$i] = false;
}
}
}Expected output
I would think PHPStan should accept this code as valid.