1--TEST--
2Test strftime() function : usage variation - Checking date related formats which was not supported on Windows before VC14.
3--FILE--
4<?php
5/* Prototype  : string strftime(string format [, int timestamp])
6 * Description: Format a local time/date according to locale settings
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing strftime() : usage variation ***\n";
12
13// Initialise function arguments not being substituted (if any)
14setlocale(LC_ALL, "C");
15date_default_timezone_set("Asia/Calcutta");
16$timestamp = mktime(8, 8, 8, 8, 8, 2008);
17
18//array of values to iterate over
19$inputs = array(
20	  'Century number' => "%C",
21	  'Month Date Year' => "%D",
22	  'Year with century' => "%G",
23	  'Year without century' => "%g",
24);
25
26// loop through each element of the array for timestamp
27
28foreach($inputs as $key =>$value) {
29      echo "\n--$key--\n";
30	  var_dump( strftime($value) );
31	  var_dump( strftime($value, $timestamp) );
32}
33
34?>
35===DONE===
36--EXPECTF--
37*** Testing strftime() : usage variation ***
38
39--Century number--
40string(2) "20"
41string(2) "20"
42
43--Month Date Year--
44string(%d) "%d/%d/%d"
45string(8) "08/08/08"
46
47--Year with century--
48string(4) "%d"
49string(4) "2008"
50
51--Year without century--
52string(2) "%d"
53string(2) "08"
54===DONE===
55