Are PHP DateInterval comparable like DateTime?
问题 I discovered that a DateTime object in PHP can be compared to another as the ">" and "<" operators are overloaded. Is it the same with DateInterval? As I was trying to answer this question, I found something strange: <?php $today = new DateTime(); $release = new DateTime('14-02-2012'); $building_time = new DateInterval('P15D'); var_dump($today->diff($release)); var_dump($building_time); var_dump($today->diff($release)>$building_time); var_dump($today->diff($release)<$building_time); if($today