xref: /PHP-8.0/Zend/tests/match/040.phpt (revision 9fa1d133)
1--TEST--
2Test match with mixed int/string jumptable
3--FILE--
4<?php
5
6function test($value) {
7    echo match ($value) {
8        1 => '1 int',
9        '1' => '1 string',
10        2 => '2 int',
11        '2' => '2 string',
12        3 => '3 int',
13        '3' => '3 string',
14        4 => '4 int',
15        '4' => '4 string',
16        5 => '5 int',
17        '5' => '5 string',
18    };
19    echo "\n";
20}
21
22test(1);
23test('1');
24test(2);
25test('2');
26test(3);
27test('3');
28test(4);
29test('4');
30test(5);
31test('5');
32
33?>
34--EXPECT--
351 int
361 string
372 int
382 string
393 int
403 string
414 int
424 string
435 int
445 string
45