I have a problem in this code:
while ($end <= $to){
$currentDates = array("from" => $start, "to"=>$end);
$allDates[] = $currentDates;
echo 'from: ', $currentDates["from"]->format("m-d-y"),'<br>';
unset($currentDates);
$start->add($intervalObj);
$end->add($intervalObj);
}
var_dump($allDates);
the echo in the loop shows the correct values but vardump shows the last dates to be added to the array in all the positions of the array