1--TEST--
2Test gmstrftime() function : usage variation - Checking time related formats which was not supported on Windows before VC14.
3--FILE--
4<?php
5echo "*** Testing gmstrftime() : usage variation ***\n";
6
7// Initialise function arguments not being substituted (if any)
8$timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
9setlocale(LC_ALL, "C");
10date_default_timezone_set("Asia/Calcutta");
11
12//array of values to iterate over
13$inputs = array(
14      'Time in a.m/p.m notation' => "%r",
15      'Time in 24 hour notation' => "%R",
16      'Current time %H:%M:%S format' => "%T",
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( gmstrftime($value) );
24      var_dump( gmstrftime($value, $timestamp) );
25};
26
27?>
28--EXPECTF--
29*** Testing gmstrftime() : usage variation ***
30
31--Time in a.m/p.m notation--
32
33Deprecated: Function gmstrftime() is deprecated in %s on line %d
34string(%d) "%d:%d:%d %c%c"
35
36Deprecated: Function gmstrftime() is deprecated in %s on line %d
37string(11) "08:08:08 AM"
38
39--Time in 24 hour notation--
40
41Deprecated: Function gmstrftime() is deprecated in %s on line %d
42string(%d) "%d:%d"
43
44Deprecated: Function gmstrftime() is deprecated in %s on line %d
45string(5) "08:08"
46
47--Current time %H:%M:%S format--
48
49Deprecated: Function gmstrftime() is deprecated in %s on line %d
50string(%d) "%d:%d:%d"
51
52Deprecated: Function gmstrftime() is deprecated in %s on line %d
53string(8) "08:08:08"
54