1--TEST--
2Test gmdate() function : usage variation - Passing predefined constants to format argument.
3--FILE--
4<?php
5echo "*** Testing gmdate() : usage variation ***\n";
6
7// Initialise all required variables
8date_default_timezone_set('UTC');
9$timestamp = mktime(8, 8, 8, 8, 8, 2008);
10
11//array of values to iterate over
12$inputs = array(
13      // Predefined Date constants
14      'DATE_ATOM Constant' => DATE_ATOM,
15      'DATE_COOKIE Constant' => DATE_COOKIE,
16      'DATE_RFC822 Constant' => DATE_RFC822,
17      'DATE_RFC850 Constant' => DATE_RFC850,
18      'DATE_RFC1036 Constant' => DATE_RFC1036,
19      'DATE_RFC1123 Constant' => DATE_RFC1123,
20      'DATE_RFC2822 Constant' => DATE_RFC2822,
21      'DATE_RFC3339 Constant' => DATE_RFC3339,
22      'DATE_RSS Constant' => DATE_RSS,
23      'DATE_W3C Constant' => DATE_W3C,
24);
25
26// loop through each element of the array for format
27foreach($inputs as $key =>$value) {
28      echo "\n--$key--\n";
29      var_dump( gmdate($value, $timestamp) );
30      var_dump( gmdate($value) );
31};
32
33?>
34--EXPECTF--
35*** Testing gmdate() : usage variation ***
36
37--DATE_ATOM Constant--
38string(25) "2008-08-08T08:08:08+00:00"
39string(%d) "%s"
40
41--DATE_COOKIE Constant--
42string(32) "Friday, 08-Aug-2008 08:08:08 GMT"
43string(%d) "%s"
44
45--DATE_RFC822 Constant--
46string(29) "Fri, 08 Aug 08 08:08:08 +0000"
47string(%d) "%s"
48
49--DATE_RFC850 Constant--
50string(30) "Friday, 08-Aug-08 08:08:08 GMT"
51string(%d) "%s"
52
53--DATE_RFC1036 Constant--
54string(29) "Fri, 08 Aug 08 08:08:08 +0000"
55string(%d) "%s"
56
57--DATE_RFC1123 Constant--
58string(31) "Fri, 08 Aug 2008 08:08:08 +0000"
59string(%d) "%s"
60
61--DATE_RFC2822 Constant--
62string(31) "Fri, 08 Aug 2008 08:08:08 +0000"
63string(%d) "%s"
64
65--DATE_RFC3339 Constant--
66string(25) "2008-08-08T08:08:08+00:00"
67string(%d) "%s"
68
69--DATE_RSS Constant--
70string(31) "Fri, 08 Aug 2008 08:08:08 +0000"
71string(%d) "%s"
72
73--DATE_W3C Constant--
74string(25) "2008-08-08T08:08:08+00:00"
75string(%d) "%s"
76