--INI--
error_reporting=2047
date.timezone=UTC
+--SKIPIF--
+<?php
+if(PHP_OS == 'Darwin') die("skip strftime depends on TZ on Darwin");
--FILE--
<?php
print "\nSetting TZ\n";
date_default_timezone_set('Australia/Sydney');
+putenv("TZ=Australia/Sydney");
$input = "10:00:00 AM July 1 2005";
print "input " . $input . "\n";
$tStamp = strtotime($input);
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--
// 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
--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===
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--
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);
--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===
--TEST--
Bug #45712 (NaN/INF comparison)
+--XFAIL--
+Bug 45712 not fixed yet.
--FILE--
<?php
// array with different values for $input
$items = array (
-
// integer values
-/*1*/ 0,
- 10,
- 2147483647,
+/*1*/ 2147483647,
-2147483648,
+ -20,
- // float values
-/*5*/ 10.5,
- 20.3,
- -20.5,
- 10.1234567e5,
-
- // array values
-/*9*/ array(),
+ // array values
+/*4*/ array(),
array(0),
array(1, 2),
- // boolean values
-/*12*/ true,
- false,
- TRUE,
- FALSE,
-
- // null vlaues
-/*16*/ NULL,
- null,
-
// objects
-/*18*/ new sample(),
+/*7*/ new sample(),
// resource
-/*19*/ $file_handle,
-
- // undefined variable
-/*20*/ @$undefined_var,
-
- // unset variable
-/*21*/ @$unset_var
-);
+/*8*/ $file_handle,
+ );
//defining '$input' argument
$input = "Test string";
*** Testing nl_langinfo() : with unexpected inputs for 'item' argument ***
-- Iteration 1 --
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 2 --
-
-Warning: nl_langinfo(): Item '10' is not valid in %s on line %d
-bool(false)
--- Iteration 3 --
-
Warning: nl_langinfo(): Item '2147483647' is not valid in %s on line %d
bool(false)
--- Iteration 4 --
+-- Iteration 2 --
Warning: nl_langinfo(): Item '-2147483648' is not valid in %s on line %d
bool(false)
--- Iteration 5 --
-
-Warning: nl_langinfo(): Item '10' is not valid in %s on line %d
-bool(false)
--- Iteration 6 --
-
-Warning: nl_langinfo(): Item '20' is not valid in %s on line %d
-bool(false)
--- Iteration 7 --
+-- Iteration 3 --
Warning: nl_langinfo(): Item '-20' is not valid in %s on line %d
bool(false)
--- Iteration 8 --
-
-Warning: nl_langinfo(): Item '1012345' is not valid in %s on line %d
-bool(false)
--- Iteration 9 --
+-- Iteration 4 --
Warning: nl_langinfo() expects parameter 1 to be long, array given in %s on line %d
NULL
--- Iteration 10 --
+-- Iteration 5 --
Warning: nl_langinfo() expects parameter 1 to be long, array given in %s on line %d
NULL
--- Iteration 11 --
+-- Iteration 6 --
Warning: nl_langinfo() expects parameter 1 to be long, array given in %s on line %d
NULL
--- Iteration 12 --
-
-Warning: nl_langinfo(): Item '1' is not valid in %s on line %d
-bool(false)
--- Iteration 13 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 14 --
-
-Warning: nl_langinfo(): Item '1' is not valid in %s on line %d
-bool(false)
--- Iteration 15 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 16 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 17 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 18 --
+-- Iteration 7 --
Warning: nl_langinfo() expects parameter 1 to be long, object given in %s on line %d
NULL
--- Iteration 19 --
+-- Iteration 8 --
Warning: nl_langinfo() expects parameter 1 to be long, resource given in %s on line %d
NULL
--- Iteration 20 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 21 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
===DONE===