We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eea2283 commit cc9c577Copy full SHA for cc9c577
ext/date/tests/gh8730.phpt
@@ -0,0 +1,28 @@
1
+--TEST--
2
+Bug GH-8730 (DateTime::diff miscalculation is same time zone of different type)
3
+--FILE--
4
+<?php
5
+$foo = new DateTime('2022-06-08 09:15:00', new DateTimeZone('-04:00'));
6
+$bar = new DateTime('2022-06-08 09:15:00', new DateTimeZone('US/Eastern'));
7
+print_r($foo->diff($bar));
8
+?>
9
+--EXPECT--
10
+DateInterval Object
11
+(
12
+ [y] => 0
13
+ [m] => 0
14
+ [d] => 0
15
+ [h] => 0
16
+ [i] => 0
17
+ [s] => 0
18
+ [f] => 0
19
+ [weekday] => 0
20
+ [weekday_behavior] => 0
21
+ [first_last_day_of] => 0
22
+ [invert] => 0
23
+ [days] => 0
24
+ [special_type] => 0
25
+ [special_amount] => 0
26
+ [have_weekday_relative] => 0
27
+ [have_special_relative] => 0
28
+)
0 commit comments