1--TEST--
2Test gmstrftime() function : usage variation - Passing week 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);
9
10//array of values to iterate over
11$inputs = array(
12      'Abbreviated weekday name' => "%a",
13      'Full weekday name' => "%A",
14      'Week number of the year' => "%U",
15      'Week number of the year in decimal number' => "%W",
16);
17
18// loop through each element of the array for timestamp
19
20foreach($inputs as $key =>$value) {
21      echo "\n--$key--\n";
22      var_dump( gmstrftime($value) );
23      var_dump( gmstrftime($value, $timestamp) );
24};
25
26?>
27--EXPECTF--
28*** Testing gmstrftime() : usage variation ***
29
30--Abbreviated weekday name--
31
32Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
33string(%d) "%s"
34
35Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
36string(3) "Fri"
37
38--Full weekday name--
39
40Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
41string(%d) "%s"
42
43Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
44string(6) "Friday"
45
46--Week number of the year--
47
48Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
49string(%d) "%d"
50
51Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
52string(2) "31"
53
54--Week number of the year in decimal number--
55
56Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
57string(%d) "%d"
58
59Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
60string(2) "31"
61