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