xref: /PHP-8.4/tests/lang/023.phpt (revision ed64e1d5)
1--TEST--
2Regression test
3--INI--
4date.timezone=UTC
5--FILE--
6PHP Regression Test
7
8<?php
9
10include("023-1.inc");
11
12$wedding_timestamp = mktime(20,0,0,8,31,1997);
13$time_left=$wedding_timestamp-time();
14
15if ($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--
28PHP Regression Test
29
30<html>
31<head>
32
33*** Testing assignments and variable aliasing: ***<br>
34This should read "blah": blah<br>
35This should read "this is nifty": this is nifty<br>
36*************************************************<br>
37
38*** Testing integer operators ***<br>
39Correct result - 8:  8<br>
40Correct result - 8:  8<br>
41Correct result - 2:  2<br>
42Correct result - -2:  -2<br>
43Correct result - 15:  15<br>
44Correct result - 15:  15<br>
45Correct result - 2:  2<br>
46Correct result - 3:  3<br>
47*********************************<br>
48
49*** Testing real operators ***<br>
50Correct result - 8:  8<br>
51Correct result - 8:  8<br>
52Correct result - 2:  2<br>
53Correct result - -2:  -2<br>
54Correct result - 15:  15<br>
55Correct result - 15:  15<br>
56Correct result - 2:  2<br>
57Correct result - 3:  3<br>
58*********************************<br>
59
60*** Testing if/elseif/else control ***<br>
61
62This  works<br>
63this_still_works<br>
64should_print<br>
65
66
67*** Seriously nested if's test ***<br>
68** spelling correction by kluzz **
69Only two lines of text should follow:<br>
70this should be displayed. should be:  $i=1, $j=0.  is:  $i=1, $j=0<br>
71this is supposed to be displayed. should be:  $i=2, $j=4.  is:  $i=2, $j=4<br>
723 loop iterations should follow:<br>
732 4<br>
743 4<br>
754 4<br>
76**********************************<br>
77
78*** C-style else-if's ***<br>
79This should be displayed<br>
80*************************<br>
81
82*** WHILE tests ***<br>
830 is smaller than 20<br>
841 is smaller than 20<br>
852 is smaller than 20<br>
863 is smaller than 20<br>
874 is smaller than 20<br>
885 is smaller than 20<br>
896 is smaller than 20<br>
907 is smaller than 20<br>
918 is smaller than 20<br>
929 is smaller than 20<br>
9310 is smaller than 20<br>
9411 is smaller than 20<br>
9512 is smaller than 20<br>
9613 is smaller than 20<br>
9714 is smaller than 20<br>
9815 is smaller than 20<br>
9916 is smaller than 20<br>
10017 is smaller than 20<br>
10118 is smaller than 20<br>
10219 is smaller than 20<br>
10320 equals 20<br>
10421 is greater than 20<br>
10522 is greater than 20<br>
10623 is greater than 20<br>
10724 is greater than 20<br>
10825 is greater than 20<br>
10926 is greater than 20<br>
11027 is greater than 20<br>
11128 is greater than 20<br>
11229 is greater than 20<br>
11330 is greater than 20<br>
11431 is greater than 20<br>
11532 is greater than 20<br>
11633 is greater than 20<br>
11734 is greater than 20<br>
11835 is greater than 20<br>
11936 is greater than 20<br>
12037 is greater than 20<br>
12138 is greater than 20<br>
12239 is greater than 20<br>
123*******************<br>
124
125
126*** Nested WHILEs ***<br>
127Each 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>
158commented out...
159**************************<br>
160
161*** Hash resizing test ***<br>
162ba<br>
163baa<br>
164baaa<br>
165baaaa<br>
166baaaaa<br>
167baaaaaa<br>
168baaaaaaa<br>
169baaaaaaaa<br>
170baaaaaaaaa<br>
171baaaaaaaaaa<br>
172ba<br>
17310<br>
174baa<br>
1759<br>
176baaa<br>
1778<br>
178baaaa<br>
1797<br>
180baaaaa<br>
1816<br>
182baaaaaa<br>
1835<br>
184baaaaaaa<br>
1854<br>
186baaaaaaaa<br>
1873<br>
188baaaaaaaaa<br>
1892<br>
190baaaaaaaaaa<br>
1911<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>
249This is Finish.phtml.  This file is supposed to be included
250from regression_test.phtml.  This is normal HTML.
251and this is PHP code, 2+2=4
252</html>
253********************************<br>
254
255Tests completed.<br>
256Limor Ullmann is now Limor Baruch :I
257