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