xref: /PHP-8.1/ext/date/tests/bug78452.phpt (revision 091c0920)
1--TEST--
2Bug #78452 (diff makes wrong in hour for Asia/Tehran)
3--FILE--
4<?php
5date_default_timezone_set('Asia/Tehran');
6$date1 = new \DateTime('2019-09-24 11:47:24');
7$date2 = new \DateTime('2019-08-21 12:47:24');
8var_dump($date1->diff($date2));
9?>
10--EXPECT--
11object(DateInterval)#3 (16) {
12  ["y"]=>
13  int(0)
14  ["m"]=>
15  int(1)
16  ["d"]=>
17  int(2)
18  ["h"]=>
19  int(23)
20  ["i"]=>
21  int(0)
22  ["s"]=>
23  int(0)
24  ["f"]=>
25  float(0)
26  ["weekday"]=>
27  int(0)
28  ["weekday_behavior"]=>
29  int(0)
30  ["first_last_day_of"]=>
31  int(0)
32  ["invert"]=>
33  int(1)
34  ["days"]=>
35  int(33)
36  ["special_type"]=>
37  int(0)
38  ["special_amount"]=>
39  int(0)
40  ["have_weekday_relative"]=>
41  int(0)
42  ["have_special_relative"]=>
43  int(0)
44}
45