xref: /PHP-8.1/ext/date/tests/bug49081.phpt (revision 55626549)
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    [weekday] => 0
22    [weekday_behavior] => 0
23    [first_last_day_of] => 0
24    [invert] => 0
25    [days] => 30
26    [special_type] => 0
27    [special_amount] => 0
28    [have_weekday_relative] => 0
29    [have_special_relative] => 0
30)
31