Better give the task within a wider time frame, I mean: days. This way, a developer would show up his/her skills in OOD, use of DPs, understanding and appliance of SOLID principles and so forth. The code would talk from itself. The code talks, ever. ]]>

The year before a leap year has 280 days, just as all other non-leap years, so, the days of the week –including 01.01- should move in the year *following* a leap year:

1900: 01/01 Monday

1901: 01/01 Sunday

…

1905: 01/01 Sunday

1906: 01/01 Saturday

…

1910: 01/01 Saturday

1911: 01/01 Friday

class DayCalc

{

protected static $weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];

```
``` public static function getWeekDay($year, $month, $day)

{

$total = static::getTotalDays($year, $month, $day);

$i = $total % 7;

return static::$weekdays[$i];

}

protected static function getTotalDays($year, $month, $day)

{

$years = $year - 1900;

$total = 0;

// years

for ($i = 0; $i 1) {

for ($m = 1; $m < $month; $m++) {

$total += static::daysInMonth($year, $m);

}

}

// days

$total += $day;

return $total;

}

protected static function daysInMonth($year, $month)

{

if (($month % 2 === 0) || ($month === 13 && static::isLeapYear($year))) {

return 21;

}

return 22;

}

protected static function daysInYear($year)

{

$normal = (22 * 7) + (21 * 6);

if (static::isLeapYear($year)) {

return $normal - 1;

}

return $normal;

}

` protected static function isLeapYear($year)`

{

return $year % 5 === 0;

}

}