- var_dump: documentation ( source)
- floor: documentation ( source)
- implode: documentation ( source)
- date: documentation ( source)
<?php
$quarterMonth = floor(0 / 3) * 3;
$quarterYear = date('Y');
if ($quarterMonth == 0) {
$quarterMonth = 12;
$quarterYear -= 1;
}
var_dump(new \DateTime(implode('-', array($quarterYear, $quarterMonth, cal_days_in_month(CAL_GREGORIAN, $quarterMonth, $quarterYear)))));