Skip to content

Commit ef89f51

Browse files
committed
test int range
1 parent 59b9507 commit ef89f51

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug-12393b.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,28 @@ public function doBar(): void
216216
}
217217
}
218218

219+
class FooIntRangeString
220+
{
221+
222+
public string $foo;
223+
224+
/**
225+
* @param int<5, 10> $b
226+
*/
227+
public function doFoo(int $b): void
228+
{
229+
$this->foo = $b;
230+
assertType('string', $this->foo); // could be numeric-string
231+
}
232+
233+
public function doBar(): void
234+
{
235+
$i = rand(5, 10);
236+
$this->foo = $i;
237+
assertType('string', $this->foo); // could be numeric-string
238+
}
239+
}
240+
219241
class FooFloatString
220242
{
221243

0 commit comments

Comments
 (0)