Back to index

php5  5.3.10
DateTime_data-february.inc
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * Note: test names match method names in a set of PHPUnit tests
00005  * in a userland package.  Please be so kind as to leave them.
00006  */
00007 
00008 date_default_timezone_set('America/New_York');
00009 
00010 
00011 /*
00012  * Check PHP bug 49081
00013  */
00014 echo "test_bug_49081__1: ";
00015 examine_diff('2010-03-31', '2010-03-01', 'P+0Y0M30DT0H0M0S', 30);
00016 
00017 echo "test_bug_49081__2: ";
00018 examine_diff('2010-04-01', '2010-03-01', 'P+0Y1M0DT0H0M0S', 31);
00019 
00020 echo "test_bug_49081__3: ";
00021 examine_diff('2010-04-01', '2010-03-31', 'P+0Y0M1DT0H0M0S', 1);
00022 
00023 echo "test_bug_49081__4: ";
00024 examine_diff('2010-04-29', '2010-03-31', 'P+0Y0M29DT0H0M0S', 29);
00025 
00026 echo "test_bug_49081__5: ";
00027 examine_diff('2010-04-30', '2010-03-31', 'P+0Y0M30DT0H0M0S', 30);
00028 
00029 echo "test_bug_49081__6: ";
00030 examine_diff('2010-04-30', '2010-03-30', 'P+0Y1M0DT0H0M0S', 31);
00031 
00032 echo "test_bug_49081__7: ";
00033 examine_diff('2010-04-30', '2010-03-29', 'P+0Y1M1DT0H0M0S', 32);
00034 
00035 echo "test_bug_49081__8: ";
00036 examine_diff('2010-01-29', '2010-01-01', 'P+0Y0M28DT0H0M0S', 28);
00037 
00038 echo "test_bug_49081__9: ";
00039 examine_diff('2010-01-30', '2010-01-01', 'P+0Y0M29DT0H0M0S', 29);
00040 
00041 echo "test_bug_49081__10: ";
00042 examine_diff('2010-01-31', '2010-01-01', 'P+0Y0M30DT0H0M0S', 30);
00043 
00044 echo "test_bug_49081__11: ";
00045 examine_diff('2010-02-01', '2010-01-01', 'P+0Y1M0DT0H0M0S', 31);
00046 
00047 echo "test_bug_49081__12: ";
00048 examine_diff('2010-02-01', '2010-01-31', 'P+0Y0M1DT0H0M0S', 1);
00049 
00050 echo "test_bug_49081__13: ";
00051 examine_diff('2010-02-27', '2010-01-31', 'P+0Y0M27DT0H0M0S', 27);
00052 
00053 echo "test_bug_49081__14: ";
00054 examine_diff('2010-02-28', '2010-01-31', 'P+0Y0M28DT0H0M0S', 28);
00055 
00056 echo "test_bug_49081__15: ";
00057 examine_diff('2010-02-28', '2010-01-30', 'P+0Y0M29DT0H0M0S', 29);
00058 
00059 echo "test_bug_49081__16: ";
00060 examine_diff('2010-02-28', '2010-01-29', 'P+0Y0M30DT0H0M0S', 30);
00061 
00062 echo "test_bug_49081__17: ";
00063 examine_diff('2010-02-28', '2010-01-28', 'P+0Y1M0DT0H0M0S', 31);
00064 
00065 echo "test_bug_49081__18: ";
00066 examine_diff('2010-02-28', '2010-01-27', 'P+0Y1M1DT0H0M0S', 32);
00067 
00068 echo "test_bug_49081__19: ";
00069 examine_diff('2010-03-01', '2010-01-01', 'P+0Y2M0DT0H0M0S', 59);
00070 
00071 echo "test_bug_49081__20: ";
00072 examine_diff('2010-03-01', '2010-01-31', 'P+0Y0M29DT0H0M0S', 29);
00073 
00074 // NOTE: sub() produces different answer.
00075 echo "test_bug_49081__21: ";
00076 examine_diff('2010-03-27', '2010-01-31', 'P+0Y1M24DT0H0M0S', 55);
00077 
00078 // NOTE: sub() produces different answer.
00079 echo "test_bug_49081__22: ";
00080 examine_diff('2010-03-28', '2010-01-31', 'P+0Y1M25DT0H0M0S', 56);
00081 
00082 // NOTE: sub() produces different answer.
00083 echo "test_bug_49081__23: ";
00084 examine_diff('2010-03-29', '2010-01-31', 'P+0Y1M26DT0H0M0S', 57);
00085 
00086 // NOTE: sub() produces different answer.
00087 echo "test_bug_49081__24: ";
00088 examine_diff('2010-03-30', '2010-01-31', 'P+0Y1M27DT0H0M0S', 58);
00089 
00090 echo "test_bug_49081__25: ";
00091 examine_diff('2010-03-31', '2010-01-31', 'P+0Y2M0DT0H0M0S', 59);
00092 
00093 echo "test_bug_49081__26: ";
00094 examine_diff('2010-03-31', '2010-01-30', 'P+0Y2M1DT0H0M0S', 60);
00095 
00096 echo "test_bug_49081__27: ";
00097 examine_diff('2009-01-31', '2009-01-01', 'P+0Y0M30DT0H0M0S', 30);
00098 
00099 echo "test_bug_49081__28: ";
00100 examine_diff('2010-03-27', '2010-02-28', 'P+0Y0M27DT0H0M0S', 27);
00101 
00102 echo "test_bug_49081__29: ";
00103 examine_diff('2010-03-28', '2010-02-28', 'P+0Y1M0DT0H0M0S', 28);
00104 
00105 echo "test_bug_49081__30: ";
00106 examine_diff('2010-03-29', '2010-02-28', 'P+0Y1M1DT0H0M0S', 29);
00107 
00108 echo "test_bug_49081__31: ";
00109 examine_diff('2010-03-27', '2010-02-27', 'P+0Y1M0DT0H0M0S', 28);
00110 
00111 echo "test_bug_49081__32: ";
00112 examine_diff('2010-03-27', '2010-02-26', 'P+0Y1M1DT0H0M0S', 29);
00113 
00114 
00115 /*
00116  * Check PHP bug 49081, negative
00117  */
00118 echo "test_bug_49081_negative__1: ";
00119 examine_diff('2010-03-01', '2010-03-31', 'P-0Y0M30DT0H0M0S', 30);
00120 
00121 echo "test_bug_49081_negative__2: ";
00122 examine_diff('2010-03-01', '2010-04-01', 'P-0Y1M0DT0H0M0S', 31);
00123 
00124 echo "test_bug_49081_negative__3: ";
00125 examine_diff('2010-03-31', '2010-04-01', 'P-0Y0M1DT0H0M0S', 1);
00126 
00127 echo "test_bug_49081_negative__4: ";
00128 examine_diff('2010-03-31', '2010-04-29', 'P-0Y0M29DT0H0M0S', 29);
00129 
00130 echo "test_bug_49081_negative__5: ";
00131 examine_diff('2010-03-31', '2010-04-30', 'P-0Y0M30DT0H0M0S', 30);
00132 
00133 echo "test_bug_49081_negative__6: ";
00134 examine_diff('2010-03-30', '2010-04-30', 'P-0Y1M0DT0H0M0S', 31);
00135 
00136 echo "test_bug_49081_negative__7: ";
00137 examine_diff('2010-03-29', '2010-04-30', 'P-0Y1M1DT0H0M0S', 32);
00138 
00139 echo "test_bug_49081_negative__8: ";
00140 examine_diff('2010-01-01', '2010-01-29', 'P-0Y0M28DT0H0M0S', 28);
00141 
00142 echo "test_bug_49081_negative__9: ";
00143 examine_diff('2010-01-01', '2010-01-30', 'P-0Y0M29DT0H0M0S', 29);
00144 
00145 echo "test_bug_49081_negative__10: ";
00146 examine_diff('2010-01-01', '2010-01-31', 'P-0Y0M30DT0H0M0S', 30);
00147 
00148 echo "test_bug_49081_negative__11: ";
00149 examine_diff('2010-01-01', '2010-02-01', 'P-0Y1M0DT0H0M0S', 31);
00150 
00151 echo "test_bug_49081_negative__12: ";
00152 examine_diff('2010-01-31', '2010-02-01', 'P-0Y0M1DT0H0M0S', 1);
00153 
00154 echo "test_bug_49081_negative__13: ";
00155 examine_diff('2010-01-31', '2010-02-27', 'P-0Y0M27DT0H0M0S', 27);
00156 
00157 echo "test_bug_49081_negative__14: ";
00158 examine_diff('2010-01-31', '2010-02-28', 'P-0Y0M28DT0H0M0S', 28);
00159 
00160 echo "test_bug_49081_negative__15: ";
00161 examine_diff('2010-01-30', '2010-02-28', 'P-0Y0M29DT0H0M0S', 29);
00162 
00163 echo "test_bug_49081_negative__16: ";
00164 examine_diff('2010-01-29', '2010-02-28', 'P-0Y0M30DT0H0M0S', 30);
00165 
00166 echo "test_bug_49081_negative__17: ";
00167 examine_diff('2010-01-28', '2010-02-28', 'P-0Y1M0DT0H0M0S', 31);
00168 
00169 echo "test_bug_49081_negative__18: ";
00170 examine_diff('2010-01-27', '2010-02-28', 'P-0Y1M1DT0H0M0S', 32);
00171 
00172 echo "test_bug_49081_negative__19: ";
00173 examine_diff('2010-01-01', '2010-03-01', 'P-0Y2M0DT0H0M0S', 59);
00174 
00175 // NOTE: sub() produces different answer.
00176 echo "test_bug_49081_negative__20: ";
00177 examine_diff('2010-01-31', '2010-03-01', 'P-0Y1M1DT0H0M0S', 29);
00178 
00179 // NOTE: sub() produces different answer.
00180 echo "test_bug_49081_negative__21: ";
00181 examine_diff('2010-01-31', '2010-03-27', 'P-0Y1M27DT0H0M0S', 55);
00182 
00183 // NOTE: sub() produces different answer.
00184 echo "test_bug_49081_negative__22: ";
00185 examine_diff('2010-01-31', '2010-03-28', 'P-0Y1M28DT0H0M0S', 56);
00186 
00187 // NOTE: sub() produces different answer.
00188 echo "test_bug_49081_negative__23: ";
00189 examine_diff('2010-01-31', '2010-03-29', 'P-0Y1M29DT0H0M0S', 57);
00190 
00191 // NOTE: sub() produces different answer.
00192 echo "test_bug_49081_negative__24: ";
00193 examine_diff('2010-01-31', '2010-03-30', 'P-0Y1M30DT0H0M0S', 58);
00194 
00195 echo "test_bug_49081_negative__25: ";
00196 examine_diff('2010-01-31', '2010-03-31', 'P-0Y2M0DT0H0M0S', 59);
00197 
00198 echo "test_bug_49081_negative__26: ";
00199 examine_diff('2010-01-30', '2010-03-31', 'P-0Y2M1DT0H0M0S', 60);
00200 
00201 echo "test_bug_49081_negative__27: ";
00202 examine_diff('2009-01-01', '2009-01-31', 'P-0Y0M30DT0H0M0S', 30);
00203 
00204 echo "test_bug_49081_negative__28: ";
00205 examine_diff('2010-02-28', '2010-03-27', 'P-0Y0M27DT0H0M0S', 27);
00206 
00207 echo "test_bug_49081_negative__29: ";
00208 examine_diff('2010-02-28', '2010-03-28', 'P-0Y1M0DT0H0M0S', 28);
00209 
00210 echo "test_bug_49081_negative__30: ";
00211 examine_diff('2010-02-28', '2010-03-29', 'P-0Y1M1DT0H0M0S', 29);
00212 
00213 echo "test_bug_49081_negative__31: ";
00214 examine_diff('2010-02-27', '2010-03-27', 'P-0Y1M0DT0H0M0S', 28);
00215 
00216 echo "test_bug_49081_negative__32: ";
00217 examine_diff('2010-02-26', '2010-03-27', 'P-0Y1M1DT0H0M0S', 29);