1--TEST--
2Test gmstrftime() function : usage variation - Passing date related format strings to format argument.
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, "en_US");
10date_default_timezone_set("Asia/Calcutta");
11
12
13//array of values to iterate over
14$inputs = array(
15      'Year as decimal number without a century' => "%y",
16      'Year as decimal number including the century' => "%Y",
17      'Time zone offset' => "%Z",
18      'Time zone offset' => "%z",
19);
20
21// loop through each element of the array for timestamp
22
23foreach($inputs as $key =>$value) {
24      echo "\n--$key--\n";
25      var_dump( gmstrftime($value) );
26      var_dump( gmstrftime($value, $timestamp) );
27};
28
29?>
30--EXPECTF--
31*** Testing gmstrftime() : usage variation ***
32
33--Year as decimal number without a century--
34string(%d) "%d"
35string(2) "08"
36
37--Year as decimal number including the century--
38string(%d) "%d"
39string(4) "2008"
40
41--Time zone offset--
42string(%s) "%s"
43string(%s) "%s"
44