Skip to content

Commit 39e51f1

Browse files
Add test
1 parent 6793632 commit 39e51f1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/PHPStan/Rules/Comparison/data/bug-13029.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,15 @@ function foo(): void
2727
[1, 1], [1, 2], [1, 0] => 0,
2828
[2, 1], [2, 0], [2, 2] => -1,
2929
};
30+
31+
/** @var 0|1 **/
32+
$int1 = 1;
33+
/** @var 0|1 **/
34+
$int2 = 0;
35+
36+
$z = match([$int1, $int2]) {
37+
[1, 0], [1, 1] => 1,
38+
[0, 0] => 0,
39+
[0, 1] => -1,
40+
};
3041
}

0 commit comments

Comments
 (0)