xref: /PHP-8.2/ext/date/tests/007.phpt (revision 852485d8)
1--TEST--
2localtime() tests
3--FILE--
4<?php
5date_default_timezone_set('UTC');
6
7$t = mktime(0,0,0, 6, 27, 2006);
8
9var_dump(localtime());
10var_dump(localtime($t));
11var_dump(localtime($t, true));
12var_dump(localtime($t, false));
13
14echo "Done\n";
15?>
16--EXPECTF--
17array(9) {
18  [0]=>
19  int(%d)
20  [1]=>
21  int(%d)
22  [2]=>
23  int(%d)
24  [3]=>
25  int(%d)
26  [4]=>
27  int(%d)
28  [5]=>
29  int(%d)
30  [6]=>
31  int(%d)
32  [7]=>
33  int(%d)
34  [8]=>
35  int(%d)
36}
37array(9) {
38  [0]=>
39  int(0)
40  [1]=>
41  int(0)
42  [2]=>
43  int(0)
44  [3]=>
45  int(27)
46  [4]=>
47  int(5)
48  [5]=>
49  int(106)
50  [6]=>
51  int(2)
52  [7]=>
53  int(177)
54  [8]=>
55  int(0)
56}
57array(9) {
58  ["tm_sec"]=>
59  int(0)
60  ["tm_min"]=>
61  int(0)
62  ["tm_hour"]=>
63  int(0)
64  ["tm_mday"]=>
65  int(27)
66  ["tm_mon"]=>
67  int(5)
68  ["tm_year"]=>
69  int(106)
70  ["tm_wday"]=>
71  int(2)
72  ["tm_yday"]=>
73  int(177)
74  ["tm_isdst"]=>
75  int(0)
76}
77array(9) {
78  [0]=>
79  int(0)
80  [1]=>
81  int(0)
82  [2]=>
83  int(0)
84  [3]=>
85  int(27)
86  [4]=>
87  int(5)
88  [5]=>
89  int(106)
90  [6]=>
91  int(2)
92  [7]=>
93  int(177)
94  [8]=>
95  int(0)
96}
97Done
98