Help fix this error
You can easily deal with the exception by catching it, this will fix the error in the sense that you no longer need to worry about this error:
try {
$newday = $a['dayz'];
$endmonth = $a['monthz'];
$newyear = $a['yearz'];
$date = new DateTime("$newyear-$endmonth-$newday");
$date->modify('+8 day');
$year = $date->format('Y');
$month = $date->format('m');
$day = $date->format('d');
} catch(Exception $e) {
}
, - . , , DateTime .