TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
384 B

--TEST--
Match expression multiple conditions per case
--FILE--
<?php
function is_working_day($day) {
return match ($day) {
1, 7 => false,
2, 3, 4, 5, 6 => true,
};
}
function main() {
for ($i = 1; $i <= 7; $i++) {
var_dump(is_working_day($i));
}
}
?>
--EXPECT--
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(false)