Skip to content

Commit 327789e

Browse files
VincentLangletondrejmirtes
authored andcommitted
Add non regression test
1 parent 5892e8d commit 327789e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,10 @@ public function testBug6467(): void
231231
$this->analyse([__DIR__ . '/data/bug-6467.php'], []);
232232
}
233233

234+
public function testBug6642(): void
235+
{
236+
$this->treatPhpDocTypesAsCertain = true;
237+
$this->analyse([__DIR__ . '/data/bug-6642.php'], []);
238+
}
239+
234240
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug6642;
4+
5+
$i = 0;
6+
foreach([1,2,3] as $n){
7+
$bool = $i++ < 3;
8+
if($bool){
9+
}
10+
}

0 commit comments

Comments
 (0)