Skip to content

Commit ee216bf

Browse files
staabmondrejmirtes
authored andcommitted
Offset access on lowercase-string is lowercase-string
1 parent 330054e commit ee216bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/PHPStan/Analyser/nsrt/string-offsets.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
* @param int<3, 10> $threeToTen
1010
* @param int<10, max> $tenOrMore
1111
* @param int<-10, -5> $negative
12+
* @param lowercase-string $lowercase
1213
*
1314
* @return void
1415
*/
15-
function doFoo($oneToThree, $threeToTen, $tenOrMore, $negative, int $i) {
16+
function doFoo($oneToThree, $threeToTen, $tenOrMore, $negative, int $i, string $lowercase) {
1617
$s = "world";
1718
if (rand(0, 1)) {
1819
$s = "hello";
@@ -29,4 +30,6 @@ function doFoo($oneToThree, $threeToTen, $tenOrMore, $negative, int $i) {
2930

3031
$longString = "myF5HnJv799kWf8VRI7g97vwnABTwN9y2CzAVELCBfRqyqkdTzXg7BkGXcwuIOscAiT6tSuJGzVZOJnYXvkiKQzYBNjjkCPOzSKXR5YHRlVxV1BetqZz4XOmaH9mtacJ9azNYL6bNXezSBjX13BSZy02SK2udzQLbTPNQwlKadKaNkUxjtWegkb8QDFaXbzH1JENVSLVH0FYd6POBU82X1xu7FDDKYLzwsWJHBGVhG8iugjEGwLj22x5ViosUyKR";
3132
assertType("non-empty-string", $longString[$i]);
33+
34+
assertType("lowercase-string&non-empty-string", $lowercase[$i]);
3235
}

0 commit comments

Comments
 (0)