Skip to content

Commit aba344e

Browse files
committed
test union
1 parent 83091c0 commit aba344e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/PHPStan/Analyser/nsrt/count-recursive.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ public function countArrayRecursive(array $arr): void
3636
}
3737
}
3838

39+
public function countArrayUnionMode(array $arr): void
40+
{
41+
$mode = rand(0,1) ? COUNT_NORMAL : COUNT_RECURSIVE;
42+
if (count($arr, $mode) > 2) {
43+
assertType('non-empty-array', $arr);
44+
assertType('int<3, max>', count($arr, $mode));
45+
assertType('int<1, max>', count($arr, COUNT_NORMAL));
46+
assertType('int<1, max>', count($arr, COUNT_RECURSIVE));
47+
}
48+
}
49+
3950
/** @param list<int> $list */
4051
public function countList($list): void
4152
{

0 commit comments

Comments
 (0)