3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getHolidays($year = null) { if ($year === null) { $year = intval(date('Y')); } $easterDate = easter_date($year); $easterDay = date('j', $easterDate); $easterMonth = date('n', $easterDate); $easterYear = date('Y', $easterDate); $holidays = array( // Dates fixes mktime(0, 0, 0, 1, 1, $year), // 1er janvier mktime(0, 0, 0, 5, 1, $year), // Fête du travail mktime(0, 0, 0, 5, 8, $year), // Victoire des alliés mktime(0, 0, 0, 7, 14, $year), // Fête nationale mktime(0, 0, 0, 8, 15, $year), // Assomption mktime(0, 0, 0, 11, 1, $year), // Toussaint mktime(0, 0, 0, 11, 11, $year), // Armistice mktime(0, 0, 0, 12, 25, $year), // Noel // Dates variables mktime(0, 0, 0, $easterMonth, $easterDay + 2, $easterYear), mktime(0, 0, 0, $easterMonth, $easterDay + 40, $easterYear), mktime(0, 0, 0, $easterMonth, $easterDay + 50, $easterYear), ); sort($holidays); return $holidays; } $a = getHolidays(); var_dump($a);
based on 3LC47
Output for 4.3.0 - 7.1.0
array(11) { [0]=> int(1388530800) [1]=> int(1398117600) [2]=> int(1398895200) [3]=> int(1399500000) [4]=> int(1401400800) [5]=> int(1402264800) [6]=> int(1405288800) [7]=> int(1408053600) [8]=> int(1414796400) [9]=> int(1415660400) [10]=> int(1419462000) }