Skip to content

Commit

Permalink
Regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 13, 2022
1 parent 3651338 commit 1eac9e9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Expand Up @@ -83,4 +83,9 @@ public function testBug3153(): void
$this->analyse([__DIR__ . '/data/bug-3153.php'], []);
}

public function testBug5707(): void
{
$this->analyse([__DIR__ . '/data/bug-5707.php'], []);
}

}
16 changes: 16 additions & 0 deletions tests/PHPStan/Rules/Comparison/data/bug-5707.php
@@ -0,0 +1,16 @@
<?php

namespace Bug5707;

class Cl
{
protected function xx(int $maxUtf8Length = 50): string
{
$maxUtf8Length = (int) max(20, min($maxUtf8Length, 100));

for ($l = $maxUtf8Length; $l > 0; --$l) {
}

return 'x';
}
}

0 comments on commit 1eac9e9

Please sign in to comment.