0

My problem is when I uncomment those print_r's the datetime objects are comparing properly. When I don't print them first they don't compare. I have literally no idea why printing them first makes them compare properly, or what could be causing this behavior.

$difference = $edate->diff($sdate);
$check = date_interval_create_from_date_string('5 days');

//print_r($difference);
//print_r($check);


$data_array = [];

if ($difference < $check) {
     //Do Stuff
}
Mason Stedman
  • 613
  • 5
  • 12

0 Answers0