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 28GXl
Output for 5.4.0 - 5.4.31
Parse error: syntax error, unexpected end of file in /in/3LC47 on line 36
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/3LC47 on line 36
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected $ in /in/3LC47 on line 36
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/3LC47 on line 36
Process exited with code 255.