Annotation of embedaddon/php/tests/lang/020.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Switch test 1
3: --FILE--
4: <?php
5:
6: $i="abc";
7:
8: for ($j=0; $j<10; $j++) {
9: switch (1) {
10: case 1:
11: echo "In branch 1\n";
12: switch ($i) {
13: case "ab":
14: echo "This doesn't work... :(\n";
15: break;
16: case "abcd":
17: echo "This works!\n";
18: break;
19: case "blah":
20: echo "Hmmm, no worki\n";
21: break;
22: default:
23: echo "Inner default...\n";
24: }
25: for ($blah=0; $blah<200; $blah++) {
26: if ($blah==100) {
27: echo "blah=$blah\n";
28: }
29: }
30: break;
31: case 2:
32: echo "In branch 2\n";
33: break;
34: case $i:
35: echo "In branch \$i\n";
36: break;
37: case 4:
38: echo "In branch 4\n";
39: break;
40: default:
41: echo "Hi, I'm default\n";
42: break;
43: }
44: }
45: ?>
46: --EXPECT--
47: In branch 1
48: Inner default...
49: blah=100
50: In branch 1
51: Inner default...
52: blah=100
53: In branch 1
54: Inner default...
55: blah=100
56: In branch 1
57: Inner default...
58: blah=100
59: In branch 1
60: Inner default...
61: blah=100
62: In branch 1
63: Inner default...
64: blah=100
65: In branch 1
66: Inner default...
67: blah=100
68: In branch 1
69: Inner default...
70: blah=100
71: In branch 1
72: Inner default...
73: blah=100
74: In branch 1
75: Inner default...
76: blah=100
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>