// Difference from a date in the future:
$a = new DateTime('2000-01-01');
$b = new DateTime('2000-01-05');
$interval = $b->diff($a);
return $interval->days; // Returns 4
// Difference from a date in the past:
$a = new DateTime('2000-01-01');
$b = new DateTime('1999-12-28');
$interval = $a->diff($b); // Arguments swapped
return $interval->days; // Returns 4
为什么这两个函数都返回正 4?如果日期是过去的,如何返回负数?