1--TEST--
2Test strftime() function : usage variation - Checking Preferred date and time representation other than on Windows.
3--SKIPIF--
4<?php
5if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
6    die("skip Test is not valid for Windows");
7}
8if(!setlocale(LC_ALL, "POSIX")) {
9    die("skip Locale POSIX is  needed by test and is not available");
10}
11?>
12--FILE--
13<?php
14echo "*** Testing strftime() : usage variation ***\n";
15
16// Initialise function arguments not being substituted (if any)
17setlocale(LC_ALL, "POSIX");
18putenv("LC_ALL=POSIX");
19date_default_timezone_set("Asia/Calcutta");
20$timestamp = mktime(8, 8, 8, 8, 8, 2008);
21
22//array of values to iterate over
23$inputs = array(
24      'Preferred date and time representation' => "%c",
25      'Preferred date representation' => "%x",
26      'Preferred time representation' => "%X",
27);
28
29// loop through each element of the array for timestamp
30
31foreach($inputs as $key =>$value) {
32      echo "\n--$key--\n";
33      var_dump( strftime($value, $timestamp) );
34}
35
36?>
37--EXPECTF--
38*** Testing strftime() : usage variation ***
39
40--Preferred date and time representation--
41
42Deprecated: Function strftime() is deprecated in %s on line %d
43string(24) "Fri Aug  8 08:08:08 2008"
44
45--Preferred date representation--
46
47Deprecated: Function strftime() is deprecated in %s on line %d
48string(8) "08/08/08"
49
50--Preferred time representation--
51
52Deprecated: Function strftime() is deprecated in %s on line %d
53string(8) "08:08:08"
54