1--TEST--
2Test gmstrftime() function : usage variation - Checking date related formats which was not supported on Windows before VC14.
3--FILE--
4<?php
5/* Prototype  : string gmstrftime(string format [, int timestamp])
6 * Description: Format a GMT/UCT time/date according to locale settings
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing gmstrftime() : usage variation ***\n";
12
13// Initialise function arguments not being substituted (if any)
14$timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
15setlocale(LC_ALL, "C");
16date_default_timezone_set("Asia/Calcutta");
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( gmstrftime($value) );
31      var_dump( gmstrftime($value, $timestamp) );
32};
33
34?>
35===DONE===
36--EXPECTF--
37*** Testing gmstrftime() : usage variation ***
38
39--Century number--
40string(2) "%d"
41string(2) "20"
42
43--Month Date Year--
44string(%d) "%d/%d/%d"
45string(8) "08/08/08"
46
47--Year with century--
48string(%d) "%d"
49string(4) "2008"
50
51--Year without century--
52string(2) "%d"
53string(2) "08"
54===DONE===
55