File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
tests /
lang /
023.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 8 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
1: --TEST--
2: Regression test
3: --INI--
4: date.timezone=UTC
5: --FILE--
6: PHP Regression Test
7:
8: <?php
9:
10: include("023-1.inc");
11:
12: $wedding_timestamp = mktime(20,0,0,8,31,1997);
13: $time_left=$wedding_timestamp-time();
14:
15: if ($time_left>0) {
16: $days = $time_left/(24*3600);
17: $time_left -= $days*24*3600;
18: $hours = $time_left/3600;
19: $time_left -= $hours*3600;
20: $minutes = $time_left/60;
21: echo "Limor Ullmann is getting married on ".($wedding_date=date("l, F dS, Y",$wedding_timestamp)).",\nwhich is $days days, $hours hours and $minutes minutes from now.\n";
22: echo "Her hashed wedding date is $wedding_date.\n";
23: } else {
24: echo "Limor Ullmann is now Limor Baruch :I\n";
25: }
26: ?>
27: --EXPECT--
28: PHP Regression Test
29:
30: <html>
31: <head>
32:
33: *** Testing assignments and variable aliasing: ***<br>
34: This should read "blah": blah<br>
35: This should read "this is nifty": this is nifty<br>
36: *************************************************<br>
37:
38: *** Testing integer operators ***<br>
39: Correct result - 8: 8<br>
40: Correct result - 8: 8<br>
41: Correct result - 2: 2<br>
42: Correct result - -2: -2<br>
43: Correct result - 15: 15<br>
44: Correct result - 15: 15<br>
45: Correct result - 2: 2<br>
46: Correct result - 3: 3<br>
47: *********************************<br>
48:
49: *** Testing real operators ***<br>
50: Correct result - 8: 8<br>
51: Correct result - 8: 8<br>
52: Correct result - 2: 2<br>
53: Correct result - -2: -2<br>
54: Correct result - 15: 15<br>
55: Correct result - 15: 15<br>
56: Correct result - 2: 2<br>
57: Correct result - 3: 3<br>
58: *********************************<br>
59:
60: *** Testing if/elseif/else control ***<br>
61:
62: This works<br>
63: this_still_works<br>
64: should_print<br>
65:
66:
67: *** Seriously nested if's test ***<br>
68: ** spelling correction by kluzz **
69: Only two lines of text should follow:<br>
70: this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0<br>
71: this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4<br>
72: 3 loop iterations should follow:<br>
73: 2 4<br>
74: 3 4<br>
75: 4 4<br>
76: **********************************<br>
77:
78: *** C-style else-if's ***<br>
79: This should be displayed<br>
80: *************************<br>
81:
82: *** WHILE tests ***<br>
83: 0 is smaller than 20<br>
84: 1 is smaller than 20<br>
85: 2 is smaller than 20<br>
86: 3 is smaller than 20<br>
87: 4 is smaller than 20<br>
88: 5 is smaller than 20<br>
89: 6 is smaller than 20<br>
90: 7 is smaller than 20<br>
91: 8 is smaller than 20<br>
92: 9 is smaller than 20<br>
93: 10 is smaller than 20<br>
94: 11 is smaller than 20<br>
95: 12 is smaller than 20<br>
96: 13 is smaller than 20<br>
97: 14 is smaller than 20<br>
98: 15 is smaller than 20<br>
99: 16 is smaller than 20<br>
100: 17 is smaller than 20<br>
101: 18 is smaller than 20<br>
102: 19 is smaller than 20<br>
103: 20 equals 20<br>
104: 21 is greater than 20<br>
105: 22 is greater than 20<br>
106: 23 is greater than 20<br>
107: 24 is greater than 20<br>
108: 25 is greater than 20<br>
109: 26 is greater than 20<br>
110: 27 is greater than 20<br>
111: 28 is greater than 20<br>
112: 29 is greater than 20<br>
113: 30 is greater than 20<br>
114: 31 is greater than 20<br>
115: 32 is greater than 20<br>
116: 33 is greater than 20<br>
117: 34 is greater than 20<br>
118: 35 is greater than 20<br>
119: 36 is greater than 20<br>
120: 37 is greater than 20<br>
121: 38 is greater than 20<br>
122: 39 is greater than 20<br>
123: *******************<br>
124:
125:
126: *** Nested WHILEs ***<br>
127: Each array variable should be equal to the sum of its indices:<br>
128: ${test00}[0] = 0<br>
129: ${test00}[1] = 1<br>
130: ${test00}[2] = 2<br>
131: ${test01}[0] = 1<br>
132: ${test01}[1] = 2<br>
133: ${test01}[2] = 3<br>
134: ${test02}[0] = 2<br>
135: ${test02}[1] = 3<br>
136: ${test02}[2] = 4<br>
137: ${test10}[0] = 1<br>
138: ${test10}[1] = 2<br>
139: ${test10}[2] = 3<br>
140: ${test11}[0] = 2<br>
141: ${test11}[1] = 3<br>
142: ${test11}[2] = 4<br>
143: ${test12}[0] = 3<br>
144: ${test12}[1] = 4<br>
145: ${test12}[2] = 5<br>
146: ${test20}[0] = 2<br>
147: ${test20}[1] = 3<br>
148: ${test20}[2] = 4<br>
149: ${test21}[0] = 3<br>
150: ${test21}[1] = 4<br>
151: ${test21}[2] = 5<br>
152: ${test22}[0] = 4<br>
153: ${test22}[1] = 5<br>
154: ${test22}[2] = 6<br>
155: *********************<br>
156:
157: *** hash test... ***<br>
158: commented out...
159: **************************<br>
160:
161: *** Hash resizing test ***<br>
162: ba<br>
163: baa<br>
164: baaa<br>
165: baaaa<br>
166: baaaaa<br>
167: baaaaaa<br>
168: baaaaaaa<br>
169: baaaaaaaa<br>
170: baaaaaaaaa<br>
171: baaaaaaaaaa<br>
172: ba<br>
173: 10<br>
174: baa<br>
175: 9<br>
176: baaa<br>
177: 8<br>
178: baaaa<br>
179: 7<br>
180: baaaaa<br>
181: 6<br>
182: baaaaaa<br>
183: 5<br>
184: baaaaaaa<br>
185: 4<br>
186: baaaaaaaa<br>
187: 3<br>
188: baaaaaaaaa<br>
189: 2<br>
190: baaaaaaaaaa<br>
191: 1<br>
192: **************************<br>
193:
194:
195: *** break/continue test ***<br>
196: $i should go from 0 to 2<br>
197: $j should go from 3 to 4, and $q should go from 3 to 4<br>
198: $j=3<br>
199: $q=3<br>
200: $q=4<br>
201: $j=4<br>
202: $q=3<br>
203: $q=4<br>
204: $j should go from 0 to 2<br>
205: $j=0<br>
206: $j=1<br>
207: $j=2<br>
208: $k should go from 0 to 2<br>
209: $k=0<br>
210: $k=1<br>
211: $k=2<br>
212: $i=0<br>
213: $j should go from 3 to 4, and $q should go from 3 to 4<br>
214: $j=3<br>
215: $q=3<br>
216: $q=4<br>
217: $j=4<br>
218: $q=3<br>
219: $q=4<br>
220: $j should go from 0 to 2<br>
221: $j=0<br>
222: $j=1<br>
223: $j=2<br>
224: $k should go from 0 to 2<br>
225: $k=0<br>
226: $k=1<br>
227: $k=2<br>
228: $i=1<br>
229: $j should go from 3 to 4, and $q should go from 3 to 4<br>
230: $j=3<br>
231: $q=3<br>
232: $q=4<br>
233: $j=4<br>
234: $q=3<br>
235: $q=4<br>
236: $j should go from 0 to 2<br>
237: $j=0<br>
238: $j=1<br>
239: $j=2<br>
240: $k should go from 0 to 2<br>
241: $k=0<br>
242: $k=1<br>
243: $k=2<br>
244: $i=2<br>
245: ***********************<br>
246:
247: *** Nested file include test ***<br>
248: <html>
249: This is Finish.phtml. This file is supposed to be included
250: from regression_test.phtml. This is normal HTML.
251: and this is PHP code, 2+2=4
252: </html>
253: ********************************<br>
254:
255: Tests completed.<br>
256: Limor Ullmann is now Limor Baruch :I
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>