1--TEST--
2Test idate() function : usage variation - Passing supported Date format characters to format argument.
3--FILE--
4<?php
5echo "*** Testing idate() : usage variation ***\n";
6
7// Initialise function arguments not being substituted (if any)
8date_default_timezone_set("Asia/Calcutta");
9
10//array of values to iterate over
11$inputs = array(
12
13      'Day of the month' => 'd',
14      'Leap Year' =>'L',
15      'Month number' => 'm',
16      'Days in the month' => 't',
17      'Day of the week' => 'w',
18      'ISO-8601 week number' => 'W',
19      'Year (1 or 2 digits)' => 'y',
20      'Year 4 digits' => 'Y',
21      'Day of the year' => 'z',
22);
23
24// loop through each element of the array for timestamp
25foreach($inputs as $key =>$value) {
26      echo "\n--$key--\n";
27      var_dump( idate($value) );
28};
29?>
30--EXPECTF--
31*** Testing idate() : usage variation ***
32
33--Day of the month--
34int(%d)
35
36--Leap Year--
37int(%d)
38
39--Month number--
40int(%d)
41
42--Days in the month--
43int(%d)
44
45--Day of the week--
46int(%d)
47
48--ISO-8601 week number--
49int(%d)
50
51--Year (1 or 2 digits)--
52int(%d)
53
54--Year 4 digits--
55int(%d)
56
57--Day of the year--
58int(%d)
59