1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Files
archived-php-src/Zend/tests/match/001.phpt
T
2020-07-09 23:52:17 +02:00

37 lines
461 B
PHP

--TEST--
Basic match expression functionality test
--FILE--
<?php
function wordify($x) {
return match ($x) {
0 => 'Zero',
1 => 'One',
2 => 'Two',
3 => 'Three',
4 => 'Four',
5 => 'Five',
6 => 'Six',
7 => 'Seven',
8 => 'Eight',
9 => 'Nine',
};
}
for ($i = 0; $i <= 9; $i++) {
print wordify($i) . "\n";
}
?>
--EXPECT--
Zero
One
Two
Three
Four
Five
Six
Seven
Eight
Nine