xref: /PHP-5.5/ext/date/tests/date_diff1.phpt (revision fdb2709d)
1--TEST--
2Test for date_diff with timezone abbreviations.
3--INI--
4date.timezone=Europe/London
5--FILE--
6<?php
7$start = new DateTime('2010-10-04 02:18:48 EDT');
8$end   = new DateTime('2010-11-06 18:38:28 EDT');
9$int = $start->diff($end);
10var_dump($start);
11var_dump($end);
12var_dump($int);
13?>
14--EXPECT--
15object(DateTime)#1 (3) {
16  ["date"]=>
17  string(26) "2010-10-04 02:18:48.000000"
18  ["timezone_type"]=>
19  int(2)
20  ["timezone"]=>
21  string(3) "EDT"
22}
23object(DateTime)#2 (3) {
24  ["date"]=>
25  string(26) "2010-11-06 18:38:28.000000"
26  ["timezone_type"]=>
27  int(2)
28  ["timezone"]=>
29  string(3) "EDT"
30}
31object(DateInterval)#3 (15) {
32  ["y"]=>
33  int(0)
34  ["m"]=>
35  int(1)
36  ["d"]=>
37  int(2)
38  ["h"]=>
39  int(16)
40  ["i"]=>
41  int(19)
42  ["s"]=>
43  int(40)
44  ["weekday"]=>
45  int(0)
46  ["weekday_behavior"]=>
47  int(0)
48  ["first_last_day_of"]=>
49  int(0)
50  ["invert"]=>
51  int(0)
52  ["days"]=>
53  int(33)
54  ["special_type"]=>
55  int(0)
56  ["special_amount"]=>
57  int(0)
58  ["have_weekday_relative"]=>
59  int(0)
60  ["have_special_relative"]=>
61  int(0)
62}
63