Skip to content

Commit f7268e0

Browse files
Add non regression test
1 parent 582adc1 commit f7268e0

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ public function testBug9850(): void
245245
$this->analyse([__DIR__ . '/data/bug-9850.php'], []);
246246
}
247247

248+
public function testBug9180(): void
249+
{
250+
$this->treatPhpDocTypesAsCertain = true;
251+
$this->analyse([__DIR__ . '/data/bug-9180.php'], []);
252+
}
253+
248254
public function testBug12716(): void
249255
{
250256
$this->treatPhpDocTypesAsCertain = true;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace Bug9180;
4+
5+
$queue = new \SplQueue();
6+
7+
$queue->push(1);
8+
9+
if ($queue->count() > 0) {
10+
for ($i=0;$i<5;$i++) {
11+
while ($queue->count() > 0 && $value = $queue->shift()) {
12+
//do something with $value
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)