xref: /PHP-7.3/ext/date/tests/008.phpt (revision 782352c5)
1--TEST--
2getdate() tests
3--FILE--
4<?php
5date_default_timezone_set('UTC');
6
7$t = mktime(0,0,0, 6, 27, 2006);
8var_dump(getdate(1,1));
9
10var_dump(getdate($t));
11var_dump(getdate());
12
13echo "Done\n";
14?>
15--EXPECTF--
16Warning: getdate() expects at most 1 parameter, 2 given in %s on line %d
17bool(false)
18array(11) {
19  ["seconds"]=>
20  int(0)
21  ["minutes"]=>
22  int(0)
23  ["hours"]=>
24  int(0)
25  ["mday"]=>
26  int(27)
27  ["wday"]=>
28  int(2)
29  ["mon"]=>
30  int(6)
31  ["year"]=>
32  int(2006)
33  ["yday"]=>
34  int(177)
35  ["weekday"]=>
36  string(7) "Tuesday"
37  ["month"]=>
38  string(4) "June"
39  [0]=>
40  int(1151366400)
41}
42array(11) {
43  ["seconds"]=>
44  int(%d)
45  ["minutes"]=>
46  int(%d)
47  ["hours"]=>
48  int(%d)
49  ["mday"]=>
50  int(%d)
51  ["wday"]=>
52  int(%d)
53  ["mon"]=>
54  int(%d)
55  ["year"]=>
56  int(%d)
57  ["yday"]=>
58  int(%d)
59  ["weekday"]=>
60  string(%d) "%s"
61  ["month"]=>
62  string(%d) "%s"
63  [0]=>
64  int(%d)
65}
66Done
67