File tree 1 file changed +50
-0
lines changed
1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #81263 (Wrong result from DateTimeImmutable::diff)
3
+ --FILE--
4
+ <?php
5
+
6
+ $ dt1 = new DateTimeImmutable ('2020-07-19 18:30:00 ' , new DateTimeZone ('Europe/Berlin ' ));
7
+ $ dt2 = new DateTimeImmutable ('2020-07-19 16:30:00 ' , new DateTimeZone ('UTC ' ));
8
+
9
+ print_r ($ dt2 ->diff ($ dt1 ));
10
+ print_r ($ dt1 ->diff ($ dt2 ));
11
+ ?>
12
+ --EXPECTF--
13
+ DateInterval Object
14
+ (
15
+ [y] => 0
16
+ [m] => 0
17
+ [d] => 0
18
+ [h] => 0
19
+ [i] => 0
20
+ [s] => 0
21
+ [f] => 0
22
+ [weekday] => 0
23
+ [weekday_behavior] => 0
24
+ [first_last_day_of] => 0
25
+ [invert] => 0
26
+ [days] => 0
27
+ [special_type] => 0
28
+ [special_amount] => 0
29
+ [have_weekday_relative] => 0
30
+ [have_special_relative] => 0
31
+ )
32
+ DateInterval Object
33
+ (
34
+ [y] => 0
35
+ [m] => 0
36
+ [d] => 0
37
+ [h] => 0
38
+ [i] => 0
39
+ [s] => 0
40
+ [f] => 0
41
+ [weekday] => 0
42
+ [weekday_behavior] => 0
43
+ [first_last_day_of] => 0
44
+ [invert] => 1
45
+ [days] => 0
46
+ [special_type] => 0
47
+ [special_amount] => 0
48
+ [have_weekday_relative] => 0
49
+ [have_special_relative] => 0
50
+ )
You can’t perform that action at this time.
0 commit comments