php-src/tests/lang/022.phpt
Stig Bakken 315f4f5658 @PHP 3 regression testing framework re-born (Stig)
Took the old PHP 3 regression testing framework and rewrote it in PHP.
Should work on both Windows and UNIX, however I have not tested it on
Windows.  See tests/README for how to write tests.  Added the PHP 3
tests and converted most of them.
2000-08-27 19:46:06 +00:00

67 lines
515 B
PHP

--TEST--
Switch test 3
--POST--
--GET--
--FILE--
<?php
cfunction switchtest ($i, $j)
{
switch ($i):
case 0:
switch($j) {
case 0:
echo zero;
break;
case 1:
echo one;
break;
default:
echo $j;
break;
}
echo "\n";
break;
default:
echo "Default taken\n";
endswitch;
}
for ($i=0; $i<3; $i++) {
for ($k=0; $k<10; $k++) {
switchtest (0,$k);
}
}
?>
--EXPECT--
zero
one
2
3
4
5
6
7
8
9
zero
one
2
3
4
5
6
7
8
9
zero
one
2
3
4
5
6
7
8
9