summaryrefslogtreecommitdiff
path: root/Zend/tests/match/003.phpt
blob: 550d2277d615b3b5da38c2a7891b8d65ed779741 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Match expression default case
--FILE--
<?php

function get_value($i) {
    return match ($i) {
        1 => 1,
        2 => 2,
        default => 'default',
    };
}

echo get_value(0) . "\n";
echo get_value(1) . "\n";
echo get_value(2) . "\n";
echo get_value(3) . "\n";

?>
--EXPECT--
default
1
2
default