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(); $date = '08/05/2014'; $dlc = explode("/",$date); $dlc = strtotime($dlc[1]."/".$dlc[0]."/".$dlc[2]); if(in_array($dlc,$a))echo 'OK';
based on ViBa7
Output for 4.3.0 - 5.6.28, 7.0.0 - 7.1.0
OK
Output for hhvm-3.12.0
Fatal error: Uncaught Error: Call to undefined function easter_date() in /in/28GXl:9 Stack trace: #0 /in/28GXl(35): getHolidays() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: Call to undefined function easter_date() in /in/28GXl on line 9
Process exited with code 255.