diff options
Diffstat (limited to 'Zend/tests/match/008.phpt')
-rw-r--r-- | Zend/tests/match/008.phpt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Zend/tests/match/008.phpt b/Zend/tests/match/008.phpt new file mode 100644 index 0000000000..db91d80b87 --- /dev/null +++ b/Zend/tests/match/008.phpt @@ -0,0 +1,25 @@ +--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, + }; +} + +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) |