Skip to content

Commit 1eac9e9

Browse files
committed
Regression test
Closes phpstan/phpstan#5707
1 parent 3651338 commit 1eac9e9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Diff for: tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,9 @@ public function testBug3153(): void
8383
$this->analyse([__DIR__ . '/data/bug-3153.php'], []);
8484
}
8585

86+
public function testBug5707(): void
87+
{
88+
$this->analyse([__DIR__ . '/data/bug-5707.php'], []);
89+
}
90+
8691
}

Diff for: tests/PHPStan/Rules/Comparison/data/bug-5707.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Bug5707;
4+
5+
class Cl
6+
{
7+
protected function xx(int $maxUtf8Length = 50): string
8+
{
9+
$maxUtf8Length = (int) max(20, min($maxUtf8Length, 100));
10+
11+
for ($l = $maxUtf8Length; $l > 0; --$l) {
12+
}
13+
14+
return 'x';
15+
}
16+
}

0 commit comments

Comments
 (0)