]> granicus.if.org Git - php/commitdiff
Sorting out the tests *once* more.
authorDerick Rethans <derick@php.net>
Wed, 7 Dec 2011 19:24:58 +0000 (19:24 +0000)
committerDerick Rethans <derick@php.net>
Wed, 7 Dec 2011 19:24:58 +0000 (19:24 +0000)
Please keep them consistent and only change them if you are 110% certain what
you're doing. Otherwise -> please ask.

ext/date/tests/bug28088.phpt
ext/date/tests/bug33415-2.phpt
ext/date/tests/bug52062-64bit.phpt [new file with mode: 0644]
ext/date/tests/bug52062.phpt
ext/date/tests/bug52113.phpt [moved from ext/date/tests/bug51223.phpt with 98% similarity]
ext/date/tests/bug53502.phpt
ext/date/tests/gmstrftime_variation22.phpt
ext/date/tests/strftime_variation22.phpt

index 95866e00be4610c6bb1bd180ec2fa53413e7da46..c310139383520c025c49d08f4e4b9fb2990cfed8 100644 (file)
@@ -1,9 +1,9 @@
 --TEST--
 Bug #28088 (strtotime() cannot convert 00 hours")
+--INI--
+date.timezone=UTC
 --FILE--
 <?php
-putenv("TZ=GMT");
-
 echo "The following line rightly shows the correct date time:\n";
 echo gmdate("m/d/y Hi", strtotime("04/04/04 2345")), "\n";
 
index 50fface88b26825bdbda21b9119b1042990ce681..424be76fc4f5e8c0a4181f0969bdbc0206e2fed5 100644 (file)
@@ -2,14 +2,10 @@
 Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts)
 --FILE--
 <?php
+date_default_timezone_set('Africa/Bujumbura');
 
 print "TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
 have a DST or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Africa/Bujumbura');
-} else {
-       putenv("TZ=Africa/Bujumbura");
-}
 $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);
@@ -17,11 +13,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/Thimbu - Is it OK for this to be 0:30 AM? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Asia/Thimbu');
-} else {
-       putenv("TZ=Asia/Thimbu");
-}
+date_default_timezone_set('Asia/Thimbu');
 $tStamp = mktime (17, 17, 17, 1, 6476, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -30,11 +22,7 @@ print "wanted=Thursday            00:30:00\n\n";
 
 print "TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
 appear to have a DST or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Indian/Cocos');
-} else {
-       putenv("TZ=Indian/Cocos");
-}
+date_default_timezone_set('Indian/Cocos');
 $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 Thursday", $tStamp);
@@ -43,11 +31,7 @@ print "wanted=Thursday            00:00:00\n\n";
 
 print "TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
 not appear to have a DST or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Africa/Lubumbashi');
-} else {
-       putenv("TZ=Africa/Lubumbashi");
-}
+date_default_timezone_set('Africa/Lubumbashi');
 $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);
@@ -55,11 +39,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/Kashgar - Is it OK for this to be 3 AM? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Asia/Kashgar');
-} else {
-       putenv("TZ=Asia/Kashgar");
-}
+date_default_timezone_set('Asia/Kashgar');
 $tStamp = mktime (17, 17, 17, 1, 3767, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -68,11 +48,7 @@ print "wanted=Thursday            03:00:00\n\n";
 
 print "TZ=Indian/Christmas - Is it OK for this to be 7 AM?  Note: does
 not appear to have a DST or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Indian/Christmas');
-} else {
-       putenv("TZ=Indian/Christmas");
-}
+date_default_timezone_set('Indian/Christmas');
 $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 Sunday", $tStamp);
@@ -80,11 +56,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/Santo_Domingo - Is it OK for this to be 0:30 AM? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('America/Santo_Domingo');
-} else {
-       putenv("TZ=America/Santo_Domingo");
-}
+date_default_timezone_set('America/Santo_Domingo');
 $tStamp = mktime (17, 17, 17, 1, 291, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -93,11 +65,7 @@ print "wanted=Sunday            00:30:00\n\n";
 
 print "TZ=Pacific/Truk - Is it OK for this to be 10 AM?  Note: does not
 appear to have a DST or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Truk');
-} else {
-       putenv("TZ=Pacific/Truk");
-}
+date_default_timezone_set('Pacific/Truk');
 $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);
@@ -106,11 +74,7 @@ print "wanted=Tuesday            00:00:00\n\n";
 
 print "TZ=Pacific/Ponape - Is it OK for this to be 11 AM?  Note: does
 not appear to have a DST or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Ponape');
-} else {
-       putenv("TZ=Pacific/Ponape");
-}
+date_default_timezone_set('Pacific/Ponape');
 $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);
@@ -118,11 +82,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/Scoresbysund - Is it OK for this to be 2 AM? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('America/Scoresbysund');
-} else {
-       putenv("TZ=America/Scoresbysund");
-}
+date_default_timezone_set('America/Scoresbysund');
 $tStamp = mktime (17, 17, 17, 1, 4099, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -130,11 +90,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Sunday            02:00:00\n\n";
 
 print "TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('America/Guyana');
-} else {
-       putenv("TZ=America/Guyana");
-}
+date_default_timezone_set('America/Guyana');
 $tStamp = mktime (17, 17, 17, 1, 2031, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -142,11 +98,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Thursday            00:45:00\n\n";
 
 print "TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Asia/Tehran');
-} else {
-       putenv("TZ=Asia/Tehran");
-}
+date_default_timezone_set('Asia/Tehran');
 $tStamp = mktime (17, 17, 17, 1, 2855, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
@@ -155,11 +107,7 @@ print "wanted=Tuesday            00:30:00\n\n";
 
 print "TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
 not appear to have a DST or timezone transition.\n";     
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Tarawa');
-} else {
-       putenv("TZ=Pacific/Tarawa");
-}
+date_default_timezone_set('Pacific/Tarawa');
 $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);
@@ -167,11 +115,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=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Africa/Monrovia');
-} else {
-       putenv("TZ=Africa/Monrovia");
-}
+date_default_timezone_set('Africa/Monrovia');
 $tStamp = mktime (17, 17, 17, 1, 845, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Monday", $tStamp);
@@ -179,11 +123,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Monday            00:44:30\n\n";
 
 print "TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Asia/Katmandu');
-} else {
-       putenv("TZ=Asia/Katmandu");
-}
+date_default_timezone_set('Asia/Katmandu');
 $tStamp = mktime (17, 17, 17, 1, 5838, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
@@ -191,11 +131,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Wednesday            00:15:00\n\n";         
 
 print "TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Nauru');
-} else {
-       putenv("TZ=Pacific/Nauru");
-}
+date_default_timezone_set('Pacific/Nauru');
 $tStamp = mktime (17, 17, 17, 1, 3401, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
@@ -203,11 +139,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
 print "wanted=Tuesday            00:30:00\n\n";
 
 print "TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Niue');
-} else {
-       putenv("TZ=Pacific/Niue");
-}
+date_default_timezone_set('Pacific/Niue');
 $tStamp = mktime (17, 17, 17, 1, 3189, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Sunday", $tStamp);
@@ -216,11 +148,7 @@ print "wanted=Sunday            00:30:00\n\n";
 
 print "TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
 or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Port_Moresby');
-} else {
-       putenv("TZ=Pacific/Port_Moresby");
-}
+date_default_timezone_set('Pacific/Port_Moresby');
 $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 Thursday", $tStamp); 
@@ -228,11 +156,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/Miquelon - Is it OK for this to be 1 AM ? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('America/Miquelon');
-} else {
-       putenv("TZ=America/Miquelon");
-}
+date_default_timezone_set('America/Miquelon');
 $tStamp = mktime (17, 17, 17, 1, 3767, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Thursday", $tStamp);
@@ -241,11 +165,7 @@ print "wanted=Thursday            01:00:00\n\n";
 
 print "TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
 timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Palau');
-} else {
-       putenv("TZ=Pacific/Palau");
-} 
+date_default_timezone_set('Pacific/Palau');
 $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);
@@ -254,11 +174,7 @@ print "wanted=Saturday            00:00:00\n\n";
 
 print "TZ=Pacific/Funafuti - Is it OK for this to be midday?  Note: does
 not appear to have a DST or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Funafuti');
-} else {
-       putenv("TZ=Pacific/Funafuti");
-} 
+date_default_timezone_set('Pacific/Funafuti');
 $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);
@@ -267,11 +183,7 @@ print "wanted=Wednesday            00:00:00\n\n";
 
 print "TZ=Pacific/Wake - Is it OK for this to be midday?  Note: does not
 appear to have a DST or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Wake');
-} else {
-       putenv("TZ=Pacific/Wake");
-} 
+date_default_timezone_set('Pacific/Wake');
 $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);
@@ -280,11 +192,7 @@ print "wanted=Tuesday            00:00:00\n\n";
 
 print "TZ=Pacific/Wallis - Is it OK for this to be midday?  Note: does
 not appear to have a DST or timezone transition.\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('Pacific/Wallis');
-} else {
-       putenv("TZ=Pacific/Wallis");
-} 
+date_default_timezone_set('Pacific/Wallis');
 $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);
@@ -292,11 +200,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/Paramaribo - Is it OK for this to be 0:30 AM? yes\n";
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-       date_default_timezone_set('America/Paramaribo');
-} else {
-       putenv("TZ=America/Paramaribo");
-} 
+date_default_timezone_set('America/Paramaribo');
 $tStamp = mktime (17, 17, 17, 1, 5381, 1970);
 print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
 $strtotime_tstamp = strtotime("next Monday", $tStamp);
diff --git a/ext/date/tests/bug52062-64bit.phpt b/ext/date/tests/bug52062-64bit.phpt
new file mode 100644 (file)
index 0000000..861e578
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (64 bit)
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 4) die('skip 64 bit only');
+?>
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+$d = new DateTime('@100000000000');
+var_dump($d->format('Y-m-d H:i:s U'));
+var_dump($d->getTimestamp());
+
+$d->setTimestamp(100000000000);
+var_dump($d->format('Y-m-d H:i:s U'));
+var_dump($d->getTimestamp());
+
+$i = new DateInterval('PT100000000000S');
+var_dump($i->format('%s'));
+?>
+--EXPECT--
+string(32) "5138-11-16 09:46:40 100000000000"
+int(100000000000)
+string(32) "5138-11-16 09:46:40 100000000000"
+int(100000000000)
+string(12) "100000000000"
index ae8fbc381de8b2154f2eef67e3968e105ce88fbe..c992a2847fecc1f4624e2c44979d1f2e8fadc7d2 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
-Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp
+Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (32 bit)
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 8) die('skip 32-bit only');
+?>
+--INI--
+date.timezone=UTC
 --FILE--
 <?php
 $d = new DateTime('@100000000000');
similarity index 98%
rename from ext/date/tests/bug51223.phpt
rename to ext/date/tests/bug52113.phpt
index cb91d1d99b0aef4a24ad381b03efad2aaae4b8a2..8d8569b0af6f2b3b23772c1c2e793aaa331f377a 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 Bug #52113: Seg fault while creating (by unserialization) DatePeriod
+--INI--
+date.timezone=UTC
 --FILE--
 <?php
 $start = new DateTime('2003-01-02 08:00:00');
index 6c17078090f6cfa47b1bbde938c0d8b0393dd9c3..87b648e354f91d27eccc38c1f24f66d63273355a 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 Bug #53502: strtotime with timezone memory leak
+--INI--
+date.timezone=UTC
 --FILE--
 <?php
 for ($i = 0; $i < 1000; $i++) {
index 198941871c5818d606ba1cf9b1b6fc05e639c13d..d9abdce17af36aeafcd0e9991163c0ac6afd7c31 100644 (file)
@@ -5,8 +5,8 @@ Test gmstrftime() function : usage variation - Checking Preferred date and time
 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
     die("skip Test is not valid for Windows");
 }
-if (!setlocale(LC_ALL, "en_US.utf8", "en_US")) {
-    die("skip Locale en_US or en_US.utf8 is required to run this test");
+if (!setlocale(LC_TIME, "POSIX")) {
+    die("skip Locale POSIX is required to run this test");
 }
 ?>
 --FILE--
@@ -21,7 +21,8 @@ echo "*** Testing gmstrftime() : usage variation ***\n";
 
 // Initialise function arguments not being substituted (if any)
 $timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
-setlocale(LC_ALL, "en_US.utf8", "en_US");
+setlocale(LC_TIME, "POSIX");
+putenv("LC_TIME=POSIX");
 date_default_timezone_set("Asia/Calcutta");
 
 //array of values to iterate over
@@ -46,13 +47,13 @@ foreach($inputs as $key =>$value) {
 
 --Preferred date and time representation--
 string(2) "%c"
-string(31) "Fri 08 Aug 2008 08:08:08 AM GMT"
+string(24) "Fri Aug  8 08:08:08 2008"
 
 --Preferred date representation--
 string(2) "%x"
-string(10) "08/08/2008"
+string(8) "08/08/08"
 
 --Preferred time representation--
 string(2) "%X"
-string(11) "08:08:08 AM"
+string(8) "08:08:08"
 ===DONE===
index 151a7d20673a6e578198443d7d6a99de3e79a0f4..7b72ca51e1e4083523aff52b73d57c02c37cd93e 100644 (file)
@@ -5,8 +5,8 @@ Test strftime() function : usage variation - Checking Preferred date and time re
 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
     die("skip Test is not valid for Windows");
 }
-if(!setlocale(LC_ALL, "en_US.utf8", "en_US")) {
-       die("skip Locale en_US.utf8 or en_US is  needed by test and is not available");
+if(!setlocale(LC_ALL, "POSIX")) {
+       die("skip Locale POSIX is  needed by test and is not available");
 }
 ?>
 --FILE--
@@ -20,7 +20,8 @@ if(!setlocale(LC_ALL, "en_US.utf8", "en_US")) {
 echo "*** Testing strftime() : usage variation ***\n";
 
 // Initialise function arguments not being substituted (if any)
-setlocale(LC_ALL, "en_US.utf8", "en_US");
+setlocale(LC_ALL, "POSIX");
+putenv("LC_ALL=POSIX");
 date_default_timezone_set("Asia/Calcutta");
 $timestamp = mktime(8, 8, 8, 8, 8, 2008);
 
@@ -46,13 +47,13 @@ foreach($inputs as $key =>$value) {
 
 --Preferred date and time representation--
 string(2) "%c"
-string(31) "Fri 08 Aug 2008 08:08:08 AM IST"
+string(24) "Fri Aug  8 08:08:08 2008"
 
 --Preferred date representation--
 string(2) "%x"
-string(10) "08/08/2008"
+string(8) "08/08/08"
 
 --Preferred time representation--
 string(2) "%X"
-string(11) "08:08:08 AM"
+string(8) "08:08:08"
 ===DONE===