$now = new DateTime(\'now\');
$tomorrow = new DateTime(\'tomorrow\');
$next_year = new DateTime(\'+1 year\');
echo \"\";
print_r($now->diff($tomorrow)
its a bug http://bugs.php.net/bug.php?id=49778
Thank you for your bug report.
Days is indeed not set when creating a DateInterval using the constructor. A complication with this is that it is impossible to determine the number of days when months or years are specified, since these vary in length. It is possible to fill in the days field in some cases and leave it 0 in others. In any case, it should be documented that the days field is not always available.