1--TEST--
2Test gmstrftime() function : usage variation - Checking time related formats which are supported 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}
8?>
9--FILE--
10<?php
11echo "*** Testing gmstrftime() : usage variation ***\n";
12
13// Initialise function arguments not being substituted (if any)
14$timestamp = gmmktime(14, 8, 8, 8, 8, 2008);
15setlocale(LC_ALL, "en_US");
16date_default_timezone_set("Asia/Calcutta");
17
18//array of values to iterate over
19$inputs = array(
20      'Time in a.m/p.m notation' => "%r",
21      'Time in 24 hour notation' => "%R",
22      'Current time %H:%M:%S format' => "%T",
23);
24
25// loop through each element of the array for timestamp
26
27foreach($inputs as $key =>$value) {
28      echo "\n--$key--\n";
29      var_dump( gmstrftime($value) );
30      var_dump( gmstrftime($value, $timestamp) );
31};
32
33?>
34--EXPECTF--
35*** Testing gmstrftime() : usage variation ***
36
37--Time in a.m/p.m notation--
38
39Deprecated: Function gmstrftime() is deprecated in %s on line %d
40string(%d) "%d:%d:%d %s"
41
42Deprecated: Function gmstrftime() is deprecated in %s on line %d
43string(11) "02:08:08 PM"
44
45--Time in 24 hour notation--
46
47Deprecated: Function gmstrftime() is deprecated in %s on line %d
48string(%d) "%d:%d"
49
50Deprecated: Function gmstrftime() is deprecated in %s on line %d
51string(5) "14:08"
52
53--Current time %H:%M:%S format--
54
55Deprecated: Function gmstrftime() is deprecated in %s on line %d
56string(%d) "%d:%d:%d"
57
58Deprecated: Function gmstrftime() is deprecated in %s on line %d
59string(8) "14:08:08"
60