xref: /PHP-8.3/Zend/tests/match/039.phpt (revision 9fa1d133)
1--TEST--
2Test match with duplicate conditions
3--FILE--
4<?php
5
6$value = 1;
7
8echo match ($value) {
9    1 => 1,
10    2 => 2,
11    3 => 3,
12    4 => 4,
13    5 => 5,
14    1 => 6,
15};
16echo "\n";
17
18echo match ($value) {
19    2, 1 => '2, 1',
20    1 => 1,
21    3 => 3,
22    4 => 4,
23    5 => 5,
24};
25echo "\n";
26
27echo match ($value) {
28    1, 1 => '1, 1',
29    2, 2 => '2, 2',
30    3, 3 => '3, 3',
31    4, 4 => '4, 4',
32    5, 5 => '5, 5',
33};
34echo "\n";
35
36echo match ($value) {
37    1 => 1,
38    1 => 2,
39};
40echo "\n";
41
42echo match ($value) {
43    2, 1 => '2, 1',
44    1 => 1,
45};
46echo "\n";
47
48echo match ($value) {
49    1, 1 => '1, 1',
50    1 => 1,
51};
52echo "\n";
53
54?>
55--EXPECT--
561
572, 1
581, 1
591
602, 1
611, 1
62