023.phpt 5.3 KB

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