xref: /PHP-8.2/ext/date/tests/bug49081.phpt (revision c8a6a8ab)
1--TEST--
2Bug #49081 (DateTime::diff() mistake if start in January and interval > 28 days)
3--FILE--
4<?php
5   date_default_timezone_set('Europe/Berlin');
6   $d1 = new DateTime('2010-01-01 06:00:00');
7   $d2 = new DateTime('2010-01-31 10:00:00');
8   $d  = $d1->diff($d2);
9   print_r($d);
10?>
11--EXPECT--
12DateInterval Object
13(
14    [y] => 0
15    [m] => 0
16    [d] => 30
17    [h] => 4
18    [i] => 0
19    [s] => 0
20    [f] => 0
21    [invert] => 0
22    [days] => 30
23    [from_string] =>
24)
25