xref: /PHP-8.4/Zend/tests/match/041.phpt (revision 9fa1d133)
1--TEST--
2Match expression with trailing comma in condition list
3--FILE--
4<?php
5
6function print_bool($bool) {
7    echo match ($bool) {
8        false,
9        0,
10            => "false\n",
11        true,
12        1,
13            => "true\n",
14        default,
15            => "not bool\n",
16    };
17}
18
19print_bool(false);
20print_bool(0);
21print_bool(true);
22print_bool(1);
23print_bool(2);
24print_bool('foo');
25
26?>
27--EXPECT--
28false
29false
30true
31true
32not bool
33not bool
34