xref: /PHP-8.2/ext/date/tests/bug71700.phpt (revision c8a6a8ab)
1--TEST--
2Bug #71700 (Extra day on diff between begin and end of march 2016)
3--INI--
4date.timezone=Europe/Paris
5--FILE--
6<?php
7$date1 = new \DateTime('2016-03-01');
8$date2 = new \DateTime('2016-03-31');
9
10$diff = date_diff($date1, $date2, true);
11
12var_dump($diff);
13?>
14--EXPECTF--
15object(DateInterval)#3 (%d) {
16  ["y"]=>
17  int(0)
18  ["m"]=>
19  int(0)
20  ["d"]=>
21  int(30)
22  ["h"]=>
23  int(0)
24  ["i"]=>
25  int(0)
26  ["s"]=>
27  int(0)
28  ["f"]=>
29  float(0)
30  ["invert"]=>
31  int(0)
32  ["days"]=>
33  int(30)
34  ["from_string"]=>
35  bool(false)
36}
37