xref: /PHP-8.2/Zend/tests/match/003.phpt (revision 9fa1d133)
1--TEST--
2Match expression default case
3--FILE--
4<?php
5
6function get_value($i) {
7    return match ($i) {
8        1 => 1,
9        2 => 2,
10        default => 'default',
11    };
12}
13
14echo get_value(0) . "\n";
15echo get_value(1) . "\n";
16echo get_value(2) . "\n";
17echo get_value(3) . "\n";
18
19?>
20--EXPECT--
21default
221
232
24default
25