summaryrefslogtreecommitdiff
path: root/ext/date/tests
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2009-06-24 22:49:04 +0200
committerSean Finney <seanius@debian.org>2009-06-24 22:49:04 +0200
commit84f4ca9b07fe5b73d840258f4aa7c1eb534c4253 (patch)
tree9829bd578af8a4a8b42b04277f9067e00dc5ad90 /ext/date/tests
parent6821b67124604da690c5e9276d5370d679c63ac8 (diff)
downloadphp-84f4ca9b07fe5b73d840258f4aa7c1eb534c4253.tar.gz
Imported Upstream version 5.3.0~RC4upstream/5.3.0_RC4upstream/5.3.0.RC4
Diffstat (limited to 'ext/date/tests')
-rw-r--r--ext/date/tests/002.phpt6
-rw-r--r--ext/date/tests/009_win32.phpt8
-rw-r--r--ext/date/tests/DateTimeZone_getOffset_basic1.phpt2
-rw-r--r--ext/date/tests/bug13142.phpt4
-rw-r--r--ext/date/tests/bug14561.phpt3
-rw-r--r--ext/date/tests/bug17988.phpt3
-rw-r--r--ext/date/tests/bug20382-1.phpt3
-rw-r--r--ext/date/tests/bug20382-2.phpt2
-rw-r--r--ext/date/tests/bug21399.phpt3
-rw-r--r--ext/date/tests/bug21966.phpt4
-rw-r--r--ext/date/tests/bug26090.phpt3
-rw-r--r--ext/date/tests/bug26317.phpt3
-rw-r--r--ext/date/tests/bug26320.phpt3
-rw-r--r--ext/date/tests/bug26694.phpt3
-rw-r--r--ext/date/tests/bug27719.phpt12
-rw-r--r--ext/date/tests/bug27780.phpt2
-rw-r--r--ext/date/tests/bug28024.phpt3
-rw-r--r--ext/date/tests/bug29150.phpt3
-rw-r--r--ext/date/tests/bug30532.phpt4
-rw-r--r--ext/date/tests/bug32086.phpt4
-rw-r--r--ext/date/tests/bug32270.phpt3
-rw-r--r--ext/date/tests/bug32555.phpt3
-rw-r--r--ext/date/tests/bug32588.phpt3
-rw-r--r--ext/date/tests/bug33414-1.phpt49
-rw-r--r--ext/date/tests/bug33414-2.phpt18
-rw-r--r--ext/date/tests/bug33415-1.phpt4
-rw-r--r--ext/date/tests/bug33532.phpt4
-rw-r--r--ext/date/tests/bug35425.phpt3
-rw-r--r--ext/date/tests/bug45682.phpt32
-rw-r--r--ext/date/tests/bug46108.phpt19
-rw-r--r--ext/date/tests/bug48058.phpt29
-rw-r--r--ext/date/tests/bug48097.phpt38
-rw-r--r--ext/date/tests/date_add_basic2.phpt14
-rw-r--r--ext/date/tests/date_create-relative.phpt93
-rw-r--r--ext/date/tests/date_create_from_format_basic.phpt14
-rw-r--r--ext/date/tests/date_create_from_format_basic2.phpt13
-rw-r--r--ext/date/tests/date_default_timezone_get-3.phpt3
-rw-r--r--ext/date/tests/date_get_last_errors_basic.phpt13
-rw-r--r--ext/date/tests/date_parse_from_format_basic.phpt14
-rw-r--r--ext/date/tests/date_sunrise_variation9.phpt12
-rw-r--r--ext/date/tests/date_sunset_variation9.phpt12
-rw-r--r--ext/date/tests/getdate_variation7.phpt34
-rw-r--r--ext/date/tests/gmdate_variation14.phpt4
-rw-r--r--ext/date/tests/gmstrftime_variation2.phpt4
-rw-r--r--ext/date/tests/idate_variation3.phpt4
-rw-r--r--ext/date/tests/localtime_variation3.phpt56
-rw-r--r--ext/date/tests/strftime_variation23.phpt4
-rw-r--r--ext/date/tests/strtotime-relative.phpt98
-rw-r--r--ext/date/tests/strtotime_basic2.phpt13
-rw-r--r--ext/date/tests/timezone_offset_get_basic1.phpt2
50 files changed, 550 insertions, 140 deletions
diff --git a/ext/date/tests/002.phpt b/ext/date/tests/002.phpt
index 7384b7424..92d0d5f10 100644
--- a/ext/date/tests/002.phpt
+++ b/ext/date/tests/002.phpt
@@ -32,16 +32,16 @@ if (!@putenv("TZ=EST5") || getenv("TZ") != 'EST5') {
);
echo "*** GMT0\n";
- putenv ("TZ=GMT0");
+ date_default_timezone_set("GMT0");
foreach ($dates as $date) {
echo date ("Y-m-d H:i:s\n", strtotime ($date));
}
echo "*** US/Eastern\n";
- putenv("TZ=US/Eastern");
+ date_default_timezone_set("US/Eastern");
if( date("T") == "GMT" ) {
// POSIX style
- putenv ("TZ=EST5EDT4,M4.1.0,M10.5.0");
+ date_default_timezone_set("EST5EDT4,M4.1.0,M10.5.0");
}
foreach ($dates as $date) {
diff --git a/ext/date/tests/009_win32.phpt b/ext/date/tests/009_win32.phpt
index 6121f625b..cbdc8b7c0 100644
--- a/ext/date/tests/009_win32.phpt
+++ b/ext/date/tests/009_win32.phpt
@@ -34,17 +34,17 @@ var_dump(gmstrftime("blah", $t));
echo "Done\n";
?>
--EXPECTF--
-Warning: strftime() expects at least 1 parameter, 0 given in C:\Users\pierre\Documents\php-sdk\vc9\x86\php_5_3\ext\date\tests\009_win32.php on line 5
+Warning: strftime() expects at least 1 parameter, 0 given in %s on line %d
bool(false)
bool(false)
-string(147) "Tue Tuesday Jun June 06/27/06 00:00:00 27 00 12 178 06 00 AM 00 26 26 2 06/27/06 00:00:00 06 2006 W. Europe Daylight Time W. Europe Daylight Time %"
+string(%d) "Tue Tuesday Jun June 06/27/06 00:00:00 27 00 12 178 06 00 AM 00 26 26 2 06/27/06 00:00:00 06 2006 %s"
string(5) "%q %a"
string(4) "blah"
-Warning: gmstrftime() expects at least 1 parameter, 0 given in C:\Users\pierre\Documents\php-sdk\vc9\x86\php_5_3\ext\date\tests\009_win32.php on line 15
+Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d
bool(false)
bool(false)
-string(146) "Mon Monday Jun June 06/26/06 21:00:00 26 21 09 177 06 00 PM 00 26 26 1 06/26/06 21:00:00 06 2006 W. Europe Standard Time W. Europe Standard Time %"
+string(%d) "Mon Monday Jun June 06/26/06 21:00:00 26 21 09 177 06 00 PM 00 26 26 1 06/26/06 21:00:00 06 2006 %s"
string(5) "%q %a"
string(4) "blah"
Done
diff --git a/ext/date/tests/DateTimeZone_getOffset_basic1.phpt b/ext/date/tests/DateTimeZone_getOffset_basic1.phpt
index 46c0e6af6..ea3c2804b 100644
--- a/ext/date/tests/DateTimeZone_getOffset_basic1.phpt
+++ b/ext/date/tests/DateTimeZone_getOffset_basic1.phpt
@@ -27,7 +27,7 @@ var_dump( $tz3->getOffset($date) );
===DONE===
--EXPECTF--
*** Testing DateTimeZone::getOffset() : basic functionality ***
-int(0)
+%rint\(0\)|int\(3600\)%r
%rint\(-18000\)|int\(-14400\)%r
%rint\(-28800\)|int\(-25200\)%r
===DONE=== \ No newline at end of file
diff --git a/ext/date/tests/bug13142.phpt b/ext/date/tests/bug13142.phpt
index 5e54263c5..60fc7e7f6 100644
--- a/ext/date/tests/bug13142.phpt
+++ b/ext/date/tests/bug13142.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #13142 (strtotime handling of "M d H:i:s Y" format)
+--INI--
+date.timezone=US/Eastern
--SKIPIF--
<?php
if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
@@ -8,7 +10,7 @@ if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
?>
--FILE--
<?php
-putenv("TZ=US/Eastern");
+
if (date('T') == 'GMT') {
putenv("TZ=EST5EDT4,M4.1.0,M10.5.0");
}
diff --git a/ext/date/tests/bug14561.phpt b/ext/date/tests/bug14561.phpt
index 98638c3e4..86a64fd8c 100644
--- a/ext/date/tests/bug14561.phpt
+++ b/ext/date/tests/bug14561.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #14561 (strtotime() bug)
+--INI--
+date.timezone=GMT
--FILE--
<?php
-putenv("TZ=GMT");
echo strtotime("19:30 Dec 17 2005"), "\n";
echo strtotime("Dec 17 19:30 2005"), "\n";
?>
diff --git a/ext/date/tests/bug17988.phpt b/ext/date/tests/bug17988.phpt
index 259fa7dc2..e758b16ae 100644
--- a/ext/date/tests/bug17988.phpt
+++ b/ext/date/tests/bug17988.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #17988 (strtotime handling of postgresql timestamps)
+--INI--
+date.timezone=GMT
--FILE--
<?php
-putenv("TZ=GMT");
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728"))."\n";
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 GMT"))."\n";
echo gmdate('Y-m-d H:i:s', strtotime("2002-06-25 14:18:48.543728 MET"))."\n";
diff --git a/ext/date/tests/bug20382-1.phpt b/ext/date/tests/bug20382-1.phpt
index a259d934a..e81ac20fd 100644
--- a/ext/date/tests/bug20382-1.phpt
+++ b/ext/date/tests/bug20382-1.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #20382 [1] (strtotime ("Monday", $date) produces wrong result on DST changeover)
+--INI--
+date.timezone=Europe/Amsterdam
--FILE--
<?php
- putenv("TZ=Europe/Amsterdam");
$tStamp = mktime (17, 17, 17, 10, 27, 2004);
echo "tStamp=". date("l Y-m-d H:i:s T", $tStamp). "\n";
diff --git a/ext/date/tests/bug20382-2.phpt b/ext/date/tests/bug20382-2.phpt
index 2026ed44d..e1f8369d2 100644
--- a/ext/date/tests/bug20382-2.phpt
+++ b/ext/date/tests/bug20382-2.phpt
@@ -32,7 +32,7 @@ $tests = array(
);
foreach ($tests as $test) {
- putenv("TZ={$test[0]}");
+ date_default_timezone_set($test[0]);
print "{$test[0]}\n";
array_shift($test);
$timestamp = call_user_func_array('mktime', $test);
diff --git a/ext/date/tests/bug21399.phpt b/ext/date/tests/bug21399.phpt
index 08040bec5..a295c8bd8 100644
--- a/ext/date/tests/bug21399.phpt
+++ b/ext/date/tests/bug21399.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #21399 (strtotime() request for "YYYYMMDDhhmmss [ZZZ]")
+--INI--
+date.timezone=GMT
--FILE--
<?php
- putenv("TZ=GMT");
echo gmdate("Y-m-d H:i:s", strtotime("20050620091407 GMT"));
?>
--EXPECT--
diff --git a/ext/date/tests/bug21966.phpt b/ext/date/tests/bug21966.phpt
index 31f592fa9..353e7e598 100644
--- a/ext/date/tests/bug21966.phpt
+++ b/ext/date/tests/bug21966.phpt
@@ -1,9 +1,9 @@
--TEST--
Bug #21966 (date() or mktime() returning bad value for mktime month param of '2')
+--INI--
+date.timezone=Europe/London
--FILE--
<?php
-putenv("TZ=Europe/London");
-
echo '27/3/04 = ' . strval(mktime(0,0,0,3,27,2004)) . "\n"; // 1080345600
echo '28/3/04 = ' . strval(mktime(0,0,0,3,28,2004)) . "\n"; // -3662 - should be 108043200
echo '28/3/04 = ' . strval(mktime(2,0,0,3,28,2004)) . "\n"; // 1080435600
diff --git a/ext/date/tests/bug26090.phpt b/ext/date/tests/bug26090.phpt
index 03a90352c..4b81949c7 100644
--- a/ext/date/tests/bug26090.phpt
+++ b/ext/date/tests/bug26090.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #26090 (allow colons in time zone offset to strtotime())
+--INI--
+date.timezone=America/New_York
--FILE--
<?php
-putenv("TZ=America/New_York");
$t = '2003-10-28 10:20:30-0800';
echo date('Y-m-d H:i:s T', strtotime($t)) . "\n";
diff --git a/ext/date/tests/bug26317.phpt b/ext/date/tests/bug26317.phpt
index aef29035e..5b79bec52 100644
--- a/ext/date/tests/bug26317.phpt
+++ b/ext/date/tests/bug26317.phpt
@@ -1,12 +1,13 @@
--TEST--
Bug #26317 (military timezone offset signedness)
+--INI--
+date.timezone=GMT0
--SKIPIF--
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
die("skip unable to change TZ enviroment variable\n");
}
--FILE--
<?php
- putenv("TZ=GMT0");
echo date("Y-m-d H:i:s\n", strtotime("2003-11-19 16:20:42 Z"));
echo date("Y-m-d H:i:s\n", strtotime("2003-11-19 09:20:42 T"));
echo date("Y-m-d H:i:s\n", strtotime("2003-11-19 19:20:42 C"));
diff --git a/ext/date/tests/bug26320.phpt b/ext/date/tests/bug26320.phpt
index 5b237cadb..c8aeb00c9 100644
--- a/ext/date/tests/bug26320.phpt
+++ b/ext/date/tests/bug26320.phpt
@@ -1,12 +1,13 @@
--TEST--
Bug #26320 (strtotime handling of XML Schema/ISO 8601 format)
+--INI--
+date.timezone=GMT0
--SKIPIF--
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
die("skip unable to change TZ enviroment variable\n");
}
--FILE--
<?php
- putenv("TZ=GMT0");
echo date("Y-m-d H:i:s\n", strtotime("2003-11-19T12:30:42"));
echo date("Y-m-d H:i:s\n", strtotime("2003-11-19T12:30:42Z"));
?>
diff --git a/ext/date/tests/bug26694.phpt b/ext/date/tests/bug26694.phpt
index a709d1666..939b04c13 100644
--- a/ext/date/tests/bug26694.phpt
+++ b/ext/date/tests/bug26694.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #26694 (strtotime() request for "Sun, 21 Dec 2003 20:38:33 +0000 GMT")
+--INI--
+date.timezone=GMT
--FILE--
<?php
- putenv("TZ=GMT");
echo gmdate("Y-m-d H:i:s", strtotime("Sun, 21 Dec 2003 20:38:33 +0000 GMT"));
?>
--EXPECT--
diff --git a/ext/date/tests/bug27719.phpt b/ext/date/tests/bug27719.phpt
index 63cdc6139..b86c32422 100644
--- a/ext/date/tests/bug27719.phpt
+++ b/ext/date/tests/bug27719.phpt
@@ -1,10 +1,10 @@
--TEST--
Bug #27719 (mktime returns incorrect timestamp for dst days)
--INI--
+date.timezone=EST
error_reporting=2047
--FILE--
-<?php /* $Id: bug27719.phpt,v 1.1 2005/07/03 14:36:59 derick Exp $ */
- putenv("TZ=EST"); // No DST
+<?php /* $Id: bug27719.phpt,v 1.1.6.1 2009/05/12 19:46:58 felipe Exp $ */
$a = mktime(0, 0, 0, 4, 4, 2004, 0);
$b = mktime(0, 0, 0, 4, 4, 2004, 1);
$c = mktime(0, 0, 0, 4, 4, 2004, -1);
@@ -12,7 +12,7 @@ error_reporting=2047
echo "$b ".date("m/d/y h:i:s\n",$b);
echo "$c ".date("m/d/y h:i:s\n",$c);
echo "\n";
- putenv("TZ=EST5EDT"); // DST not in effect
+ date_default_timezone_set('EST5EDT'); // DST not in effect
$a = mktime(0, 0, 0, 2, 4, 2004, 0);
$b = mktime(0, 0, 0, 2, 4, 2004, 1);
$c = mktime(0, 0, 0, 2, 4, 2004, -1);
@@ -20,7 +20,7 @@ error_reporting=2047
echo "$b ".date("m/d/y h:i:s\n",$b);
echo "$c ".date("m/d/y h:i:s\n",$c);
echo "\n";
- putenv("TZ=EST5EDT"); // Just before DST changeover
+ date_default_timezone_set('EST5EDT');
$a = mktime(0, 0, 0, 4, 4, 2004, 0);
$b = mktime(0, 0, 0, 4, 4, 2004, 1);
$c = mktime(0, 0, 0, 4, 4, 2004, -1);
@@ -28,7 +28,7 @@ error_reporting=2047
echo "$b ".date("m/d/y h:i:s\n",$b);
echo "$c ".date("m/d/y h:i:s\n",$c);
echo "\n";
- putenv("TZ=EST5EDT"); // Just after DST changeover
+ date_default_timezone_set('EST5EDT');
$a = mktime(3, 0, 0, 4, 4, 2004, 0);
$b = mktime(3, 0, 0, 4, 4, 2004, 1);
$c = mktime(3, 0, 0, 4, 4, 2004, -1);
@@ -36,7 +36,7 @@ error_reporting=2047
echo "$b ".date("m/d/y h:i:s\n",$b);
echo "$c ".date("m/d/y h:i:s\n",$c);
echo "\n";
- putenv("TZ=EST5EDT"); // DST in effect
+ date_default_timezone_set('EST5EDT');
$a = mktime(0, 0, 0, 6, 4, 2004, 0);
$b = mktime(0, 0, 0, 6, 4, 2004, 1);
$c = mktime(0, 0, 0, 6, 4, 2004, -1);
diff --git a/ext/date/tests/bug27780.phpt b/ext/date/tests/bug27780.phpt
index f1e6eb67b..bd3bc949b 100644
--- a/ext/date/tests/bug27780.phpt
+++ b/ext/date/tests/bug27780.phpt
@@ -24,7 +24,7 @@ $timestrings = array (
);
foreach ($timezones as $timezone) {
- putenv("TZ=$timezone");
+ date_default_timezone_set($timezone);
echo $timezone, "\n";
foreach ($timestrings as $timestring) {
diff --git a/ext/date/tests/bug28024.phpt b/ext/date/tests/bug28024.phpt
index 3e0399adb..b5f97bd5c 100644
--- a/ext/date/tests/bug28024.phpt
+++ b/ext/date/tests/bug28024.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #28024 (Changed behavior of strtotime())
+--INI--
+date.timezone=Europe/Berlin
--FILE--
<?php
- putenv("TZ=Europe/Berlin");
echo strtotime("17:00 2004-01-01"), "\n";
echo date("Y-m-d H:i:s T", strtotime("17:00 2004-01-01"));
?>
diff --git a/ext/date/tests/bug29150.phpt b/ext/date/tests/bug29150.phpt
index 274584d05..d91d68d91 100644
--- a/ext/date/tests/bug29150.phpt
+++ b/ext/date/tests/bug29150.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #29150 (Roman number format for months)
+--INI--
+date.timezone=GMT
--FILE--
<?php
- putenv("TZ=GMT");
echo gmdate("Y-m-d H:i:s", strtotime("20 VI. 2005"));
?>
--EXPECT--
diff --git a/ext/date/tests/bug30532.phpt b/ext/date/tests/bug30532.phpt
index faee0b316..6794b9dc7 100644
--- a/ext/date/tests/bug30532.phpt
+++ b/ext/date/tests/bug30532.phpt
@@ -1,8 +1,10 @@
--TEST--
Bug #30532 (strtotime - crossing daylight savings time)
+--INI--
+date.timezone=America/New_York
--FILE--
<?php
-putenv("TZ=America/New_York");
+
echo date('Y-m-d H:i:s T', strtotime('2004-10-31 EDT +1 hour'))."\n";
echo date('Y-m-d H:i:s T', strtotime('2004-10-31 EDT +2 hours'))."\n";
echo date('Y-m-d H:i:s T', strtotime('2004-10-31 EDT +3 hours'))."\n";
diff --git a/ext/date/tests/bug32086.phpt b/ext/date/tests/bug32086.phpt
index 2799164cb..e065c0bac 100644
--- a/ext/date/tests/bug32086.phpt
+++ b/ext/date/tests/bug32086.phpt
@@ -1,8 +1,10 @@
--TEST--
Bug #32086 (strtotime don't work in DST)
+--INI--
+date.timezone=America/Sao_Paulo
--FILE--
<?php
-putenv("TZ=America/Sao_Paulo");
+
echo $g = strtotime("2004-11-01"), "\n";
echo $i = strtotime("2004-11-01 +1 day"), "\n";
echo $j = strtotime("+1 day", $g), "\n";
diff --git a/ext/date/tests/bug32270.phpt b/ext/date/tests/bug32270.phpt
index 2c5ff4754..4533e0614 100644
--- a/ext/date/tests/bug32270.phpt
+++ b/ext/date/tests/bug32270.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #32270 (strtotime/date behavior)
+--INI--
+date.timezone=America/Los_Angeles
--FILE--
<?php
-putenv("TZ=America/Los_Angeles");
echo date("m/d/Y H:i:s T", -2145888000)."\n";
diff --git a/ext/date/tests/bug32555.phpt b/ext/date/tests/bug32555.phpt
index 3ef513b5e..a99d3e289 100644
--- a/ext/date/tests/bug32555.phpt
+++ b/ext/date/tests/bug32555.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #32555 (strtotime("tomorrow") can return false)
+--INI--
+date.timezone=US/Eastern
--FILE--
<?php
-putenv("TZ=US/Eastern");
$stamp = 1112427000;
print strftime('%c %Z',strtotime('now',$stamp)) ."\n";
diff --git a/ext/date/tests/bug32588.phpt b/ext/date/tests/bug32588.phpt
index 6cf5ac92f..4ecadf4e9 100644
--- a/ext/date/tests/bug32588.phpt
+++ b/ext/date/tests/bug32588.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #32588 (strtotime() error for 'last xxx' DST problem)
+--INI--
+date.timezone=America/New_York
--FILE--
<?php
-putenv("TZ=America/New_York");
echo date('D Y/m/d/H:i:s', strtotime('last saturday', 1112703348)). "\n";
echo date('D Y/m/d/H:i:s', strtotime("last sunday", 1112703348)). "\n";
diff --git a/ext/date/tests/bug33414-1.phpt b/ext/date/tests/bug33414-1.phpt
index 7b15228cf..03d9b4ca9 100644
--- a/ext/date/tests/bug33414-1.phpt
+++ b/ext/date/tests/bug33414-1.phpt
@@ -1,10 +1,11 @@
--TEST--
Bug #33414 [1] (Comprehensive list of incorrect days returned after strotime() / date() tests)
+--INI--
+date.timezone=America/Mendoza
--FILE--
<?php
print "TZ=America/Mendoza - wrong day.\n";
-putenv("TZ=America/Mendoza");
$tStamp = mktime (17, 17, 17, 1, 8327, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -12,7 +13,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Catamarca - wrong day.\n";
-putenv("TZ=America/Catamarca");
+date_default_timezone_set("America/Catamarca");
$tStamp = mktime (17, 17, 17, 1, 7599, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -20,7 +21,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Cordoba - wrong day.\n";
-putenv("TZ=America/Cordoba");
+date_default_timezone_set("America/Cordoba");
$tStamp = mktime (17, 17, 17, 1, 7599, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -28,7 +29,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Rosario - wrong day.\n";
-putenv("TZ=America/Rosario");
+date_default_timezone_set("America/Rosario");
$tStamp = mktime (17, 17, 17, 1, 7958, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
@@ -37,7 +38,7 @@ print "wanted=Tuesday 00:00:00\n\n";
print "TZ=Europe/Vienna - wrong day - giving unexpected results, at
least on my system :-)\n";
-putenv("TZ=Europe/Vienna");
+date_default_timezone_set("Europe/Vienna");
$tStamp = mktime (17, 17, 17, 1, 3746, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -45,7 +46,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Asia/Baku - wrong day.\n";
-putenv("TZ=Asia/Baku");
+date_default_timezone_set("Asia/Baku");
$tStamp = mktime (17, 17, 17, 1, 8299, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -53,7 +54,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Noronha - wrong day.\n";
-putenv("TZ=America/Noronha");
+date_default_timezone_set("America/Noronha");
$tStamp = mktime (17, 17, 17, 1, 10866, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
@@ -61,7 +62,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Friday 00:00:00\n\n";
print "TZ=America/Havana - wrong day.\n";
-putenv("TZ=America/Havana");
+date_default_timezone_set("America/Havana");
$tStamp = mktime (17, 17, 17, 1, 12720, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -69,7 +70,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Europe/Tallinn - wrong day.\n";
-putenv("TZ=Europe/Tallinn");
+date_default_timezone_set("Europe/Tallinn");
$tStamp = mktime (17, 17, 17, 1, 11777, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Saturday", $tStamp);
@@ -77,7 +78,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Saturday 00:00:00\n\n";
print "TZ=Asia/Jerusalem - wrong day.\n";
-putenv("TZ=Asia/Jerusalem");
+date_default_timezone_set("Asia/Jerusalem");
$tStamp = mktime (17, 17, 17, 1, 13056, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -85,7 +86,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Europe/Vilnius - wrong day.\n";
-putenv("TZ=Europe/Vilnius");
+date_default_timezone_set("Europe/Vilnius");
$tStamp = mktime (17, 17, 17, 1, 12140, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
@@ -93,7 +94,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Friday 00:00:00\n\n";
print "TZ=Pacific/Kwajalein - wrong day.\n";
-putenv("TZ=Pacific/Kwajalein");
+date_default_timezone_set("Pacific/Kwajalein");
$tStamp = mktime (17, 17, 17, 1, 8626, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
@@ -101,7 +102,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Friday 00:00:00\n\n";
print "TZ=Asia/Ulan_Bator - wrong day.\n";
-putenv("TZ=Asia/Ulan_Bator");
+date_default_timezone_set("Asia/Ulan_Bator");
$tStamp = mktime (17, 17, 17, 1, 11588, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Saturday", $tStamp);
@@ -109,7 +110,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Saturday 00:00:00\n\n";
print "TZ=America/Cancun - wrong day.\n";
-putenv("TZ=America/Cancun");
+date_default_timezone_set("America/Cancun");
$tStamp = mktime (17, 17, 17, 1, 11785, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -117,7 +118,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Sunday 00:00:00\n\n";
print "TZ=America/Mexico_City - wrong day.\n";
-putenv("TZ=America/Mexico_City");
+date_default_timezone_set("America/Mexico_City");
$tStamp = mktime (17, 17, 17, 1, 11781, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
@@ -125,7 +126,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Wednesday 00:00:00\n\n";
print "TZ=America/Mazatlan - wrong day.\n";
-putenv("TZ=America/Mazatlan");
+date_default_timezone_set("America/Mazatlan");
$tStamp = mktime (17, 17, 17, 1, 11780, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
@@ -133,7 +134,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Tuesday 00:00:00\n\n";
print "TZ=America/Chihuahua - wrong day.\n";
-putenv("TZ=America/Chihuahua");
+date_default_timezone_set("America/Chihuahua");
$tStamp = mktime (17, 17, 17, 1, 11782, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -141,7 +142,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Asia/Kuala_Lumpur - wrong day.\n";
-putenv("TZ=Asia/Kuala_Lumpur");
+date_default_timezone_set("Asia/Kuala_Lumpur");
$tStamp = mktime (17, 17, 17, 1, 4380, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Monday", $tStamp);
@@ -149,7 +150,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:00:00\n\n";
print "TZ=Pacific/Chatham - wrong day.\n";
-putenv("TZ=Pacific/Chatham");
+date_default_timezone_set("Pacific/Chatham");
$tStamp = mktime (17, 17, 17, 1, 1762, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Monday", $tStamp);
@@ -157,7 +158,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:00:00\n\n";
print "TZ=America/Lima - wrong day.\n";
-putenv("TZ=America/Lima");
+date_default_timezone_set("America/Lima");
$tStamp = mktime (17, 17, 17, 1, 5839, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -165,7 +166,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=Asia/Karachi - wrong day.\n";
-putenv("TZ=Asia/Karachi");
+date_default_timezone_set("Asia/Karachi");
$tStamp = mktime (17, 17, 17, 1, 11783, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
@@ -173,7 +174,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Friday 00:00:00\n\n";
print "TZ=America/Asuncion - wrong day.\n";
-putenv("TZ=America/Asuncion");
+date_default_timezone_set("America/Asuncion");
$tStamp = mktime (17, 17, 17, 1, 11746, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
@@ -181,7 +182,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Wednesday 00:00:00\n\n";
print "TZ=Asia/Singapore - wrong day.\n";
-putenv("TZ=Asia/Singapore");
+date_default_timezone_set("Asia/Singapore");
$tStamp = mktime (17, 17, 17, 1, 4383, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -189,7 +190,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Thursday 00:00:00\n\n";
print "TZ=America/Montevideo - wrong day.\n";
-putenv("TZ=America/Montevideo");
+date_default_timezone_set("America/Montevideo");
$tStamp = mktime (17, 17, 17, 1, 12678, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Thursday", $tStamp);
diff --git a/ext/date/tests/bug33414-2.phpt b/ext/date/tests/bug33414-2.phpt
index 8eb2a3569..51cbe3b9f 100644
--- a/ext/date/tests/bug33414-2.phpt
+++ b/ext/date/tests/bug33414-2.phpt
@@ -3,7 +3,7 @@ Bug #33414 [2] (Comprehensive list of incorrect days returned after strotime() /
--FILE--
<?php
print "TZ=Pacific/Rarotonga - wrong day.\n";
-putenv("TZ=Pacific/Rarotonga");
+date_default_timezone_set("Pacific/Rarotonga");
$tStamp = mktime (17, 17, 17, 1, 1, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
@@ -11,7 +11,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Tuesday 00:00:00\n\n";
print "TZ=Atlantic/South_Georgia - wrong day.\n";
-putenv("TZ=Atlantic/South_Georgia");
+date_default_timezone_set("Atlantic/South_Georgia");
$tStamp = mktime (17, 17, 17, 1, 1, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
@@ -19,7 +19,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Tuesday 00:00:00\n\n";
print "TZ=America/Port-au-Prince - wrong day.\n";
-putenv("TZ=America/Port-au-Prince");
+date_default_timezone_set("America/Port-au-Prince");
$tStamp = mktime (17, 17, 17, 1, 12871, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Monday", $tStamp);
@@ -27,7 +27,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:00:00\n\n";
print "TZ=Pacific/Enderbury - wrong day, off by 2 days.\n";
-putenv("TZ=Pacific/Enderbury");
+date_default_timezone_set("Pacific/Enderbury");
$tStamp = mktime (17, 17, 17, 1, 1, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Monday", $tStamp);
@@ -35,7 +35,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:00:00\n\n";
print "TZ=Pacific/Kiritimati - wrong day, off by 2 days.\n";
-putenv("TZ=Pacific/Kiritimati");
+date_default_timezone_set("Pacific/Kiritimati");
$tStamp = mktime (17, 17, 17, 1, 1, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Monday", $tStamp);
@@ -43,7 +43,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:00:00\n\n";
print "TZ=America/Managua - wrong day.\n";
-putenv("TZ=America/Managua");
+date_default_timezone_set("America/Managua");
$tStamp = mktime (17, 17, 17, 1, 12879, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
@@ -51,7 +51,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Tuesday 00:00:00\n\n";
print "TZ=Pacific/Pitcairn - wrong day.\n";
-putenv("TZ=Pacific/Pitcairn");
+date_default_timezone_set("Pacific/Pitcairn");
$tStamp = mktime (17, 17, 17, 1, 1, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
@@ -59,7 +59,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Wednesday 00:00:00\n\n";
print "TZ=Pacific/Fakaofo - wrong day.\n";
-putenv("TZ=Pacific/Fakaofo");
+date_default_timezone_set("Pacific/Fakaofo");
$tStamp = mktime (17, 17, 17, 1, 1, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Saturday", $tStamp);
@@ -67,7 +67,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Saturday 00:00:00\n\n";
print "TZ=Pacific/Johnston - wrong day.\n";
-putenv("TZ=Pacific/Johnston");
+date_default_timezone_set("Pacific/Johnston");
$tStamp = mktime (17, 17, 17, 1, 1, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
diff --git a/ext/date/tests/bug33415-1.phpt b/ext/date/tests/bug33415-1.phpt
index 3d36af8a5..698252a03 100644
--- a/ext/date/tests/bug33415-1.phpt
+++ b/ext/date/tests/bug33415-1.phpt
@@ -5,7 +5,7 @@ Bug #33415 [1] (Possibly invalid non-one-hour DST or timezone shifts)
print "TZ=America/Jujuy - Is it OK for this to be 2 AM, rather than 1
AM as per most DST transitions?\n";
-putenv("TZ=America/Jujuy");
+date_default_timezone_set("America/Jujuy");
$tStamp = mktime (17, 17, 17, 1, 7593, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Monday", $tStamp);
@@ -13,7 +13,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:00:00\n\n";
print "TZ=Asia/Tbilisi - Is it OK for this to be 2 AM?\n";
-putenv("TZ=Asia/Tbilisi");
+date_default_timezone_set("Asia/Tbilisi");
$tStamp = mktime (17, 17, 17, 1, 12863, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
diff --git a/ext/date/tests/bug33532.phpt b/ext/date/tests/bug33532.phpt
index 2a8da0341..286ceb4ce 100644
--- a/ext/date/tests/bug33532.phpt
+++ b/ext/date/tests/bug33532.phpt
@@ -5,7 +5,7 @@ error_reporting=2047
date.timezone=UTC
--FILE--
<?php
-putenv("TZ=");
+
setlocale(LC_ALL, 'C');
print "TZ has NOT been set\n";
@@ -17,7 +17,7 @@ print "strftime " . strftime("%r %B%e %Y %Z %z", $tStamp) . "\n";
print "datestr " . date ("H:i:s A F j Y T", $tStamp) . "\n";
print "\nSetting TZ\n";
-putenv("TZ=Australia/Sydney");
+date_default_timezone_set('Australia/Sydney');
$input = "10:00:00 AM July 1 2005";
print "input " . $input . "\n";
$tStamp = strtotime($input);
diff --git a/ext/date/tests/bug35425.phpt b/ext/date/tests/bug35425.phpt
index 4259b49a1..e55a4f521 100644
--- a/ext/date/tests/bug35425.phpt
+++ b/ext/date/tests/bug35425.phpt
@@ -1,8 +1,9 @@
--TEST--
Bug #35425 (idate() function ignores timezone settings)
+--INI--
+date.timezone=America/Montreal
--FILE--
<?php
-putenv('TZ=America/Montreal');
$time = mktime(1,1,1,1,1,2005);
foreach (array('B','d','h','H','i','I','L','m','s','t','U','w','W','y','Y','z','Z') as $v) {
diff --git a/ext/date/tests/bug45682.phpt b/ext/date/tests/bug45682.phpt
new file mode 100644
index 000000000..d8bbfc5a0
--- /dev/null
+++ b/ext/date/tests/bug45682.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug #45682 (Unable to var_dump(DateInterval))
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+
+$date = new DateTime("28-July-2008");
+$other = new DateTime("31-July-2008");
+
+$diff = date_diff($date, $other);
+
+var_dump($diff);
+--EXPECT--
+object(DateInterval)#3 (8) {
+ ["y"]=>
+ int(0)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(3)
+ ["h"]=>
+ int(0)
+ ["i"]=>
+ int(0)
+ ["s"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(3)
+}
diff --git a/ext/date/tests/bug46108.phpt b/ext/date/tests/bug46108.phpt
new file mode 100644
index 000000000..12fdfa7e5
--- /dev/null
+++ b/ext/date/tests/bug46108.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #46108 (DateTime - Memory leak when unserializing)
+--FILE--
+<?php
+
+date_default_timezone_set('America/Sao_Paulo');
+
+var_dump(unserialize(serialize(new Datetime)));
+
+?>
+--EXPECTF--
+object(DateTime)#%d (3) {
+ [%u|b%"date"]=>
+ %string|unicode%(%d) "%s"
+ [%u|b%"timezone_type"]=>
+ int(%d)
+ [%u|b%"timezone"]=>
+ %string|unicode%(%d) "America/Sao_Paulo"
+}
diff --git a/ext/date/tests/bug48058.phpt b/ext/date/tests/bug48058.phpt
new file mode 100644
index 000000000..290d3df0f
--- /dev/null
+++ b/ext/date/tests/bug48058.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #48058 (Year formatter goes wrong with out-of-int range)
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+date_default_timezone_set("Europe/London");
+$tz = new DateTimeZone("Europe/London");
+$tran = $tz->getTransitions();
+var_dump( $tran[0] );
+
+$base_time = '28 Feb 2008 12:00:00';
+$dt = date_create( "$base_time +10000000000 years" );
+echo date_format( $dt, DATE_ISO8601 );
+?>
+--EXPECT--
+array(5) {
+ ["ts"]=>
+ int(-9223372036854775808)
+ ["time"]=>
+ string(33) "-292277022657-01-27T08:29:52+0000"
+ ["offset"]=>
+ int(3600)
+ ["isdst"]=>
+ bool(true)
+ ["abbr"]=>
+ string(3) "BST"
+}
+10000002008-02-28T12:00:00+0000
diff --git a/ext/date/tests/bug48097.phpt b/ext/date/tests/bug48097.phpt
new file mode 100644
index 000000000..d71a97e5a
--- /dev/null
+++ b/ext/date/tests/bug48097.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Bug #48097 (date_timezone_set function produces wrong datetime result)
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+$d = date_create( "Mon, 23 May 1955 00:00:00 +0200" );
+var_dump( $d );
+echo $d->format( DATE_ISO8601 ), "\n";
+echo $d->format( 'U' ), "\n\n";
+
+$d->setTimeZone( new DateTimeZone( 'Europe/Budapest' ) );
+var_dump( $d );
+echo $d->format( DATE_ISO8601 ), "\n\n";
+echo $d->format( 'U' ), "\n\n";
+--EXPECT--
+object(DateTime)#1 (3) {
+ ["date"]=>
+ string(19) "1955-05-23 00:00:00"
+ ["timezone_type"]=>
+ int(1)
+ ["timezone"]=>
+ string(6) "+02:00"
+}
+1955-05-23T00:00:00+0200
+-461124000
+
+object(DateTime)#1 (3) {
+ ["date"]=>
+ string(19) "1955-05-22 23:00:00"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(15) "Europe/Budapest"
+}
+1955-05-22T23:00:00+0100
+
+-461124000
diff --git a/ext/date/tests/date_add_basic2.phpt b/ext/date/tests/date_add_basic2.phpt
new file mode 100644
index 000000000..5beef23f4
--- /dev/null
+++ b/ext/date/tests/date_add_basic2.phpt
@@ -0,0 +1,14 @@
+--TEST--
+date_add() return false with wrong params
+--CREDITS--
+"Anna Filina" <afilina@phpquebec.org>
+#PHPTestFest2009 2009-05-02
+--INI--
+date.timezone=UTC
+display_errors=false
+--FILE--
+<?php
+var_dump(date_add()); // invalid parameters
+?>
+--EXPECT--
+bool(false) \ No newline at end of file
diff --git a/ext/date/tests/date_create-relative.phpt b/ext/date/tests/date_create-relative.phpt
new file mode 100644
index 000000000..8a9093158
--- /dev/null
+++ b/ext/date/tests/date_create-relative.phpt
@@ -0,0 +1,93 @@
+--TEST--
+date_create() with large relative offsets
+--FILE--
+<?php
+
+date_default_timezone_set('UTC');
+
+if (!defined('PHP_INT_MIN')) {
+ define('PHP_INT_MIN', intval(-PHP_INT_MAX - 1));
+}
+
+$base_time = '28 Feb 2008 12:00:00';
+
+// Most offsets tested in strtotime-relative.phpt. These are tests for dates outside the 32-bit range.
+$offsets = array(
+ // around 10 leap year periods (4000 years) in days
+ '1460000 days',
+ '1460969 days',
+ '1460970 days',
+ '1460971 days',
+ '1462970 days',
+
+ // around 1 leap year period in years
+ '398 years',
+ '399 years',
+ '400 years',
+ '401 years',
+
+ // around 40000 years
+ '39755 years',
+ '39999 years',
+ '40000 years',
+ '40001 years',
+ '41010 years',
+
+ // bigger than int (32-bit)
+ '10000000000 seconds',
+ '10000000000 minutes',
+ '10000000000 hours',
+ '10000000000 days',
+ '10000000000 months',
+ '10000000000 years',
+);
+
+foreach ($offsets AS $offset) {
+ foreach (array('+', '-') AS $direction) {
+ $dt = date_create("$base_time $direction$offset");
+ echo "$direction$offset: " . date_format($dt, DATE_ISO8601) . "\n";
+ }
+}
+
+?>
+--EXPECT--
++1460000 days: 6005-07-03T12:00:00+0000
+-1460000 days: -1990-10-25T12:00:00+0000
++1460969 days: 6008-02-27T12:00:00+0000
+-1460969 days: -1992-02-29T12:00:00+0000
++1460970 days: 6008-02-28T12:00:00+0000
+-1460970 days: -1992-02-28T12:00:00+0000
++1460971 days: 6008-02-29T12:00:00+0000
+-1460971 days: -1992-02-27T12:00:00+0000
++1462970 days: 6013-08-20T12:00:00+0000
+-1462970 days: -1998-09-07T12:00:00+0000
++398 years: 2406-02-28T12:00:00+0000
+-398 years: 1610-02-28T12:00:00+0000
++399 years: 2407-02-28T12:00:00+0000
+-399 years: 1609-02-28T12:00:00+0000
++400 years: 2408-02-28T12:00:00+0000
+-400 years: 1608-02-28T12:00:00+0000
++401 years: 2409-02-28T12:00:00+0000
+-401 years: 1607-02-28T12:00:00+0000
++39755 years: 41763-02-28T12:00:00+0000
+-39755 years: -37747-02-28T12:00:00+0000
++39999 years: 42007-02-28T12:00:00+0000
+-39999 years: -37991-02-28T12:00:00+0000
++40000 years: 42008-02-28T12:00:00+0000
+-40000 years: -37992-02-28T12:00:00+0000
++40001 years: 42009-02-28T12:00:00+0000
+-40001 years: -37993-02-28T12:00:00+0000
++41010 years: 43018-02-28T12:00:00+0000
+-41010 years: -39002-02-28T12:00:00+0000
++10000000000 seconds: 2325-01-18T05:46:40+0000
+-10000000000 seconds: 1691-04-09T18:13:20+0000
++10000000000 minutes: 21021-05-27T22:40:00+0000
+-10000000000 minutes: -17006-12-01T01:20:00+0000
++10000000000 hours: 1142802-09-30T04:00:00+0000
+-10000000000 hours: -1138787-07-28T20:00:00+0000
++10000000000 days: 27381078-03-25T12:00:00+0000
+-10000000000 days: -27377062-02-02T12:00:00+0000
++10000000000 months: 833335341-06-28T12:00:00+0000
+-10000000000 months: -833331326-10-28T12:00:00+0000
++10000000000 years: 10000002008-02-28T12:00:00+0000
+-10000000000 years: -9999997992-02-28T12:00:00+0000
diff --git a/ext/date/tests/date_create_from_format_basic.phpt b/ext/date/tests/date_create_from_format_basic.phpt
new file mode 100644
index 000000000..592692b5a
--- /dev/null
+++ b/ext/date/tests/date_create_from_format_basic.phpt
@@ -0,0 +1,14 @@
+--TEST--
+date_create_from_format() return false with wrong params
+--CREDITS--
+"Anna Filina" <afilina@phpquebec.org>
+#PHPTestFest2009 2009-05-02
+--INI--
+date.timezone=UTC
+display_errors=false
+--FILE--
+<?php
+var_dump(date_create_from_format()); // invalid parameters
+?>
+--EXPECT--
+bool(false) \ No newline at end of file
diff --git a/ext/date/tests/date_create_from_format_basic2.phpt b/ext/date/tests/date_create_from_format_basic2.phpt
new file mode 100644
index 000000000..2b220a727
--- /dev/null
+++ b/ext/date/tests/date_create_from_format_basic2.phpt
@@ -0,0 +1,13 @@
+--TEST--
+date_create_from_format() return false
+--CREDITS--
+"Anna Filina" <afilina@phpquebec.org>
+#PHPTestFest2009 2009-05-02
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+var_dump(date_create_from_format('Y-m-d', '2009---01')); // invalid date
+?>
+--EXPECT--
+bool(false) \ No newline at end of file
diff --git a/ext/date/tests/date_default_timezone_get-3.phpt b/ext/date/tests/date_default_timezone_get-3.phpt
index 0e2e3c53e..ffc882e6f 100644
--- a/ext/date/tests/date_default_timezone_get-3.phpt
+++ b/ext/date/tests/date_default_timezone_get-3.phpt
@@ -1,10 +1,9 @@
--TEST--
date_default_timezone_get() function [3]
--INI--
-date.timezone=
+date.timezone=Europe/Rome
--FILE--
<?php
- putenv('TZ=Europe/Rome');
echo date_default_timezone_get(), "\n";
date_default_timezone_set("America/Chicago");
diff --git a/ext/date/tests/date_get_last_errors_basic.phpt b/ext/date/tests/date_get_last_errors_basic.phpt
new file mode 100644
index 000000000..5e83a5272
--- /dev/null
+++ b/ext/date/tests/date_get_last_errors_basic.phpt
@@ -0,0 +1,13 @@
+--TEST--
+date_get_last_errors() return false
+--CREDITS--
+"Anna Filina" <afilina@phpquebec.org>
+#PHPTestFest2009 2009-05-02
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+var_dump(date_get_last_errors()); // no date was parsed, so no errors
+?>
+--EXPECT--
+bool(false) \ No newline at end of file
diff --git a/ext/date/tests/date_parse_from_format_basic.phpt b/ext/date/tests/date_parse_from_format_basic.phpt
new file mode 100644
index 000000000..644949a2e
--- /dev/null
+++ b/ext/date/tests/date_parse_from_format_basic.phpt
@@ -0,0 +1,14 @@
+--TEST--
+date_parse_from_format() return false with wrong params
+--CREDITS--
+"Anna Filina" <afilina@phpquebec.org>
+#PHPTestFest2009 2009-05-02
+--INI--
+date.timezone=UTC
+display_errors=false
+--FILE--
+<?php
+var_dump(date_parse_from_format()); // invalid parameters
+?>
+--EXPECT--
+bool(false) \ No newline at end of file
diff --git a/ext/date/tests/date_sunrise_variation9.phpt b/ext/date/tests/date_sunrise_variation9.phpt
index ce0e9cbb4..49af06d52 100644
--- a/ext/date/tests/date_sunrise_variation9.phpt
+++ b/ext/date/tests/date_sunrise_variation9.phpt
@@ -36,12 +36,12 @@ var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $ze
\*\*\* Testing date_sunrise\(\) : usage variation \*\*\*
-- Testing date_sunrise\(\) function by passing float 12.3456789000e10 value to time --
-string\(5\) "(08:53|07:49)"
-float\((8.883[0-9]*|8.883[0-9]*|7.821[0-9]*)\)
-int\((-2147466915|123456811756)\)
+string\(5\) "(07:34|07:49)"
+float\((7.566[0-9]*|7.821[0-9]*)\)
+int\((-1097256359|123456811756)\)
-- Testing date_sunrise\(\) function by passing float -12.3456789000e10 value to time --
-string\(5\) "(08:48|08:04)"
-float\((8.810[0-9]*|8.810[0-9]*|8.074[0-9]*)\)
-int\((-2147443882|-123456761731)\)
+string\(5\) "(07:42|08:48|08:04)"
+float\((7.713[0-9]*|8.810[0-9]*|8.074[0-9]*)\)
+int\((1097304168|-2147443882|-123456761731)\)
===DONE===
diff --git a/ext/date/tests/date_sunset_variation9.phpt b/ext/date/tests/date_sunset_variation9.phpt
index 6648dfb6f..59a4b584a 100644
--- a/ext/date/tests/date_sunset_variation9.phpt
+++ b/ext/date/tests/date_sunset_variation9.phpt
@@ -36,12 +36,12 @@ var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zen
\*\*\* Testing date_sunset\(\) : usage variation \*\*\*
-- Testing date_sunset\(\) function by passing float 12.3456789000e10 value to time --
-string\(5\) "(18:40|19:28)"
-float\((18.6762[0-9]*|19.480[0-9]*)\)
-int\((-2147431662|123456853728)\)
+string\(5\) "(19:49|19:28)"
+float\((19.830[0-9]*|19.830[0-9]*|19.480[0-9]*)\)
+int\((-1097212211|123456853728)\)
-- Testing date_sunset\(\) function by passing float -12.3456789000e10 value to time --
-string\(5\) "(18:12|18:48)"
-float\((18.213[0-9]*|18.808[0-9]*)\)
-int\((-2147410031|-123456723090)\)
+string\(5\) "(19:03|18:12|18:48)"
+float\((19.056[0-9]*|18.213[0-9]*|18.808[0-9]*)\)
+int\((1097345002|-2147410031|-123456723090)\)
===DONE===
diff --git a/ext/date/tests/getdate_variation7.phpt b/ext/date/tests/getdate_variation7.phpt
index bccd8d3ab..5af2dd53f 100644
--- a/ext/date/tests/getdate_variation7.phpt
+++ b/ext/date/tests/getdate_variation7.phpt
@@ -27,52 +27,52 @@ var_dump( getdate($timestamp) );
-- Testing getdate\(\) function by passing float 12.3456789000e10 value to timestamp --
array\(11\) {
\["seconds"\]=>
- int\((7|0)\)
+ int\((36|0)\)
\["minutes"\]=>
- int\((44|0)\)
+ int\((43|0)\)
\["hours"\]=>
- int\((8|6)\)
+ int\((10|6)\)
\["mday"\]=>
- int\((19|11)\)
+ int\((26|11)\)
\["wday"\]=>
int\((2|6)\)
\["mon"\]=>
- int\((1|3)\)
+ int\(3\)
\["year"\]=>
- int\((2038|5882)\)
+ int\((1935|5882)\)
\["yday"\]=>
- int\((18|69)\)
+ int\((84|69)\)
\["weekday"\]=>
string\((7|8)\) "(Tuesday|Saturday)"
\["month"\]=>
- string\((7|5)\) "(January|March)"
+ string\(5\) "March"
\[0\]=>
- int\((2147483647|123456789000)\)
+ int\((-1097262584|123456789000)\)
}
-- Testing getdate\(\) function by passing float -12.3456789000e10 value to timestamp --
array\(11\) {
\["seconds"\]=>
- int\((12|20)\)
+ int\((44|12|20)\)
\["minutes"\]=>
int\((39|23)\)
\["hours"\]=>
- int\((2|5)\)
+ int\((0|2|5)\)
\["mday"\]=>
- int\((14|23)\)
+ int\((9|14|23)\)
\["wday"\]=>
int\((6|-4)\)
\["mon"\]=>
- int\((12|10)\)
+ int\((10|12)\)
\["year"\]=>
- int\((1901|-1943)\)
+ int\((2004|1901|-1943)\)
\["yday"\]=>
- int\((347|295)\)
+ int\((282|347|295)\)
\["weekday"\]=>
string\((8|7)\) "(Saturday|Unknown)"
\["month"\]=>
- string\((8|7)\) "(December|October)"
+ string\((7|8)\) "(October|December)"
\[0\]=>
- int\((-2147483648|-123456789000)\)
+ int\((1097262584|-2147483648|-123456789000)\)
}
===DONE===
diff --git a/ext/date/tests/gmdate_variation14.phpt b/ext/date/tests/gmdate_variation14.phpt
index 53dc647d0..5b62a8274 100644
--- a/ext/date/tests/gmdate_variation14.phpt
+++ b/ext/date/tests/gmdate_variation14.phpt
@@ -27,8 +27,8 @@ var_dump( gmdate($format, $timestamp) );
\*\*\* Testing gmdate\(\) : usage variation \*\*\*
-- Testing gmdate\(\) function with float 12.3456789000e10 to timestamp --
-string\((24|25)\) "(2038-01-19T03:14:07\+0000|5882-03-11T00:30:00\+0000)"
+string\((24|25)\) "(1935-03-26T04:50:16\+0000|5882-03-11T00:30:00\+0000)"
-- Testing gmdate\(\) function with float -12.3456789000e10 to timestamp --
-string\((24|25)\) "(1901-12-13T20:45:52\+0000|-1943-10-22T23:30:00\+0000)"
+string\((24|25)\) "(2004-10-08T19:09:44\+0000|1901-12-13T20:45:52\+0000|-1943-10-22T23:30:00\+0000)"
===DONE=== \ No newline at end of file
diff --git a/ext/date/tests/gmstrftime_variation2.phpt b/ext/date/tests/gmstrftime_variation2.phpt
index b01de9759..c577fe1d3 100644
--- a/ext/date/tests/gmstrftime_variation2.phpt
+++ b/ext/date/tests/gmstrftime_variation2.phpt
@@ -112,10 +112,10 @@ string(20) "Jan 01 1970 00:00:10"
string(20) "Dec 31 1969 23:59:50"
--float 12.3456789000e10--
-string(20) "Jan 19 2038 03:14:07"
+string(20) "Mar 26 1935 04:50:16"
--float -12.3456789000e10--
-string(20) "Dec 13 1901 20:45:52"
+string(20) "Oct 08 2004 19:09:44"
--float .5--
string(20) "Jan 01 1970 00:00:00"
diff --git a/ext/date/tests/idate_variation3.phpt b/ext/date/tests/idate_variation3.phpt
index 0546ff219..1a2ee1ffd 100644
--- a/ext/date/tests/idate_variation3.phpt
+++ b/ext/date/tests/idate_variation3.phpt
@@ -28,8 +28,8 @@ var_dump( idate($format, $timestamp) );
\*\*\* Testing idate\(\) : usage variation \*\*\*
-- Testing idate\(\) function with float 12.3456789000e10 to timestamp --
-int\((2038|5882)\)
+int\((1935|5882)\)
-- Testing idate\(\) function with float -12.3456789000e10 to timestamp --
-int\((1901|-1943)\)
+int\((2004|1901|-1943)\)
===DONE===
diff --git a/ext/date/tests/localtime_variation3.phpt b/ext/date/tests/localtime_variation3.phpt
index 7294f2ef1..d941e3891 100644
--- a/ext/date/tests/localtime_variation3.phpt
+++ b/ext/date/tests/localtime_variation3.phpt
@@ -33,41 +33,41 @@ var_dump( localtime($timestamp, $is_associative) );
-- Testing localtime\(\) function with 'float 12.3456789000e10' to timestamp --
array\(9\) {
\[0\]=>
- int\((7|0)\)
+ int\((16|0)\)
\[1\]=>
- int\((14|30)\)
+ int\((50|30)\)
\[2\]=>
- int\((3|0)\)
+ int\((4|0)\)
\[3\]=>
- int\((19|11)\)
+ int\((26|11)\)
\[4\]=>
- int\((0|2)\)
+ int\(2\)
\[5\]=>
- int\((138|3982)\)
+ int\((35|3982)\)
\[6\]=>
int\((2|6)\)
\[7\]=>
- int\((18|69)\)
+ int\((84|69)\)
\[8\]=>
int\(0\)
}
array\(9\) {
\["tm_sec"\]=>
- int\((7|0)\)
+ int\((16|0)\)
\["tm_min"\]=>
- int\((14|30)\)
+ int\((50|30)\)
\["tm_hour"\]=>
- int\((3|0)\)
+ int\((4|0)\)
\["tm_mday"\]=>
- int\((19|11)\)
+ int\((26|11)\)
\["tm_mon"\]=>
- int\((0|2)\)
+ int\(2\)
\["tm_year"\]=>
- int\((138|3982)\)
+ int\((35|3982)\)
\["tm_wday"\]=>
int\((2|6)\)
\["tm_yday"\]=>
- int\((18|69)\)
+ int\((84|69)\)
\["tm_isdst"\]=>
int\(0\)
}
@@ -75,41 +75,41 @@ array\(9\) {
-- Testing localtime\(\) function with 'float -12.3456789000e10' to timestamp --
array\(9\) {
\[0\]=>
- int\((52|0)\)
+ int\((44|52|0)\)
\[1\]=>
- int\((45|30)\)
+ int\((9|45|30)\)
\[2\]=>
- int\((20|23)\)
+ int\((19|20|23)\)
\[3\]=>
- int\((13|22)\)
+ int\((8|13|22)\)
\[4\]=>
- int\((11|9)\)
+ int\((9|11)\)
\[5\]=>
- int\((1|-3843)\)
+ int\((104|1|-3843)\)
\[6\]=>
int\((5|-5)\)
\[7\]=>
- int\((346|294)\)
+ int\((281|346|294)\)
\[8\]=>
int\(0\)
}
array\(9\) {
\["tm_sec"\]=>
- int\((52|0)\)
+ int\((44|52|0)\)
\["tm_min"\]=>
- int\((45|30)\)
+ int\((9|45|30)\)
\["tm_hour"\]=>
- int\((20|23)\)
+ int\((19|20|23)\)
\["tm_mday"\]=>
- int\((13|22)\)
+ int\((8|13|22)\)
\["tm_mon"\]=>
- int\((11|9)\)
+ int\((9|11)\)
\["tm_year"\]=>
- int\((1|-3843)\)
+ int\((104|1|-3843)\)
\["tm_wday"\]=>
int\((5|-5)\)
\["tm_yday"\]=>
- int\((346|294)\)
+ int\((281|346|294)\)
\["tm_isdst"\]=>
int\(0\)
}
diff --git a/ext/date/tests/strftime_variation23.phpt b/ext/date/tests/strftime_variation23.phpt
index 34e14cf2f..b7cf8d788 100644
--- a/ext/date/tests/strftime_variation23.phpt
+++ b/ext/date/tests/strftime_variation23.phpt
@@ -29,8 +29,8 @@ var_dump( strftime($format, $timestamp) );
\*\*\* Testing strftime\(\) : usage variation \*\*\*
-- Testing strftime\(\) function with float 12.3456789000e10 to timestamp --
-string\(\d*\)\s"(Jan|Mar)\s(19|11)\s(2038|5882)\s(03|00):(14|30):(07|00)"
+string\(\d*\)\s"Mar\s(26|11)\s(1935|5882)\s(04|00):(50|30):(16|00)"
-- Testing strftime\(\) function with float -12.3456789000e10 to timestamp --
-string\(\d*\)\s"(Dec|Oct)\s(13|22)\s(1901|-1943)\s(20|23):(45|30):(52|00)"
+string\(\d*\)\s"(Oct|Dec)\s(08|13|22)\s(2004|1901|-1943)\s(19|20|23):(09|45|30):(44|52|00)"
===DONE===
diff --git a/ext/date/tests/strtotime-relative.phpt b/ext/date/tests/strtotime-relative.phpt
new file mode 100644
index 000000000..769cd2ec2
--- /dev/null
+++ b/ext/date/tests/strtotime-relative.phpt
@@ -0,0 +1,98 @@
+--TEST--
+strtotime() with relative offsets
+--FILE--
+<?php
+
+date_default_timezone_set('UTC');
+
+$base_time = 1204200000; // 28 Feb 2008 12:00:00
+
+$offsets = array(
+ // offset around a day
+ '80412 seconds',
+ '86399 seconds',
+ '86400 seconds',
+ '86401 seconds',
+ '112913 seconds',
+
+ // offset around 7 days
+ '134 hours',
+ '167 hours',
+ '168 hours',
+ '169 hours',
+ '183 hours',
+
+ // offset around 6 months
+ '178 days',
+ '179 days',
+ '180 days',
+ '183 days',
+ '184 days',
+
+ // offset around 10 years
+ '115 months',
+ '119 months',
+ '120 months',
+ '121 months',
+ '128 months',
+
+ // offset around 25 years (can't do much more reliably with strtotime)
+ '24 years',
+ '25 years',
+ '26 years'
+);
+
+foreach ($offsets AS $offset) {
+ foreach (array('+', '-') AS $direction) {
+ echo "$direction$offset: " . date(DATE_ISO8601, strtotime("$direction$offset", $base_time)) . "\n";
+ }
+}
+
+?>
+--EXPECT--
++80412 seconds: 2008-02-29T10:20:12+0000
+-80412 seconds: 2008-02-27T13:39:48+0000
++86399 seconds: 2008-02-29T11:59:59+0000
+-86399 seconds: 2008-02-27T12:00:01+0000
++86400 seconds: 2008-02-29T12:00:00+0000
+-86400 seconds: 2008-02-27T12:00:00+0000
++86401 seconds: 2008-02-29T12:00:01+0000
+-86401 seconds: 2008-02-27T11:59:59+0000
++112913 seconds: 2008-02-29T19:21:53+0000
+-112913 seconds: 2008-02-27T04:38:07+0000
++134 hours: 2008-03-05T02:00:00+0000
+-134 hours: 2008-02-22T22:00:00+0000
++167 hours: 2008-03-06T11:00:00+0000
+-167 hours: 2008-02-21T13:00:00+0000
++168 hours: 2008-03-06T12:00:00+0000
+-168 hours: 2008-02-21T12:00:00+0000
++169 hours: 2008-03-06T13:00:00+0000
+-169 hours: 2008-02-21T11:00:00+0000
++183 hours: 2008-03-07T03:00:00+0000
+-183 hours: 2008-02-20T21:00:00+0000
++178 days: 2008-08-24T12:00:00+0000
+-178 days: 2007-09-03T12:00:00+0000
++179 days: 2008-08-25T12:00:00+0000
+-179 days: 2007-09-02T12:00:00+0000
++180 days: 2008-08-26T12:00:00+0000
+-180 days: 2007-09-01T12:00:00+0000
++183 days: 2008-08-29T12:00:00+0000
+-183 days: 2007-08-29T12:00:00+0000
++184 days: 2008-08-30T12:00:00+0000
+-184 days: 2007-08-28T12:00:00+0000
++115 months: 2017-09-28T12:00:00+0000
+-115 months: 1998-07-28T12:00:00+0000
++119 months: 2018-01-28T12:00:00+0000
+-119 months: 1998-03-28T12:00:00+0000
++120 months: 2018-02-28T12:00:00+0000
+-120 months: 1998-02-28T12:00:00+0000
++121 months: 2018-03-28T12:00:00+0000
+-121 months: 1998-01-28T12:00:00+0000
++128 months: 2018-10-28T12:00:00+0000
+-128 months: 1997-06-28T12:00:00+0000
++24 years: 2032-02-28T12:00:00+0000
+-24 years: 1984-02-28T12:00:00+0000
++25 years: 2033-02-28T12:00:00+0000
+-25 years: 1983-02-28T12:00:00+0000
++26 years: 2034-02-28T12:00:00+0000
+-26 years: 1982-02-28T12:00:00+0000
diff --git a/ext/date/tests/strtotime_basic2.phpt b/ext/date/tests/strtotime_basic2.phpt
new file mode 100644
index 000000000..f90e66da8
--- /dev/null
+++ b/ext/date/tests/strtotime_basic2.phpt
@@ -0,0 +1,13 @@
+--TEST--
+strtotime() with return false
+--CREDITS--
+"Anna Filina" <afilina@phpquebec.org>
+#PHPTestFest2009 2009-05-02
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+var_dump(strtotime('mayy 2 2009')); // misspelled month name
+?>
+--EXPECT--
+bool(false) \ No newline at end of file
diff --git a/ext/date/tests/timezone_offset_get_basic1.phpt b/ext/date/tests/timezone_offset_get_basic1.phpt
index bf241788d..aa658e942 100644
--- a/ext/date/tests/timezone_offset_get_basic1.phpt
+++ b/ext/date/tests/timezone_offset_get_basic1.phpt
@@ -28,7 +28,7 @@ var_dump(timezone_offset_get($tz, $date));
===DONE===
--EXPECTF--
*** Testing timezone_offset_get() : basic functionality ***
-int(0)
+%rint\(0\)|int\(3600\)%r
%rint\(-18000\)|int\(-14400\)%r
%rint\(-28800\)|int\(-25200\)%r
===DONE=== \ No newline at end of file