1--TEST--
2Test strftime() function : usage variation - Passing week related format strings to format argument.
3--FILE--
4<?php
5echo "*** Testing strftime() : usage variation ***\n";
6
7date_default_timezone_set("Asia/Calcutta");
8// Initialise function arguments not being substituted (if any)
9$timestamp = mktime(8, 8, 8, 8, 8, 2008);
10
11//array of values to iterate over
12$inputs = array(
13      'Abbreviated weekday name' => "%a",
14      'Full weekday name' => "%A",
15      'Week number of the year' => "%U",
16      'Week number of the year in decimal number' => "%W",
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( strftime($value) );
23      var_dump( strftime($value, $timestamp) );
24};
25
26?>
27--EXPECTF--
28*** Testing strftime() : usage variation ***
29
30--Abbreviated weekday name--
31string(%d) "%s"
32string(3) "Fri"
33
34--Full weekday name--
35string(%d) "%s"
36string(6) "Friday"
37
38--Week number of the year--
39string(%d) "%d"
40string(2) "31"
41
42--Week number of the year in decimal number--
43string(%d) "%d"
44string(2) "31"
45