[ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' 3, "1" => 4, "2" => 5, ]; function takesInt(int $s) : void {} foreach ($foo as $i => $b) { takesInt($i); }', ], 'getValidIntStringOffset' => [ ' 3, "1" => 4, "2" => 5, ]; $a = "2"; echo $foo["2"]; echo $foo[$a];', ], 'checkStringKeyValueAfterKnownIntStringOffset' => [ ' 3, "1" => 4, "2" => 5, ]; $a = "2"; $foo[$a] = 6; function takesInt(int $s) : void {} foreach ($foo as $i => $b) { takesInt($i); }', ], 'regularComparison1' => [ ' [ ' [ ' [ ' [ ' [ ' [ 'add(function() use (&$i) : void { if (rand(0, 1)) $i++; }); if ($i === 0) {} }', 'assertions' => [], 'error_levels' => ['MissingParamType', 'MixedMethodCall'], ], 'regularValueReconciliation' => [ ' [ ' [ ' [ ' [ ' [ ' [ ' 'TypeDoesNotContainType', ], 'alwaysIdenticalType' => [ ' 'RedundantCondition', ], 'alwaysNotIdenticalType' => [ ' 'RedundantCondition', ], 'neverNotIdenticalType' => [ ' 'TypeDoesNotContainType', ], 'SKIPPED-phpstanPostedArrayTest' => [ ' 'TypeDoesNotContainType', ], 'ifImpossibleString' => [ ' 'TypeDoesNotContainType', ], 'arrayOffsetImpossibleValue' => [ ' 1, "b" => 2, ]; if ($foo["a"] === 2) {}', 'error_message' => 'TypeDoesNotContainType', ], 'impossibleKeyInForeach' => [ ' 3, "1" => 4, "2" => 5, ]; function takesInt(int $s) : void {} foreach ($foo as $i => $b) { if ($i === 3) {} }', 'error_message' => 'TypeDoesNotContainType', ], 'impossibleValueInForeach' => [ ' 3, "1" => 4, "2" => 5, ]; function takesInt(int $s) : void {} foreach ($foo as $i => $b) { if ($b === $i) {} }', 'error_message' => 'TypeDoesNotContainType', ], 'invalidIntStringOffset' => [ ' 3, "1" => 4, "2" => 5, ]; $a = "3"; echo $foo[$a];', 'error_message' => 'InvalidArrayOffset', ], 'noChangeToVariable' => [ ' 'RedundantCondition', ], 'redefinedIntInIfAndImpossbleComparison' => [ ' 'TypeDoesNotContainType', ], ]; } }