- Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.24, 7.4.0 - 7.4.12
- Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in /in/ve1i7 on line 6
Process exited with code 255.
<?php
$input = '5';
$result = match($input){
0 => "hello",
'1', '2', '0' => "world",
default => 'not found'
};
echo $result
$result = '';
switch ($input) {
case 0:
$result = "hello";
break;
case '1':
case '2':
case '0':
$result = "world";
break;
default:
$result = "not found";
}
echo $result ;