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