3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $currentMonth = date("n"); $currentYear = date("Y"); echo $currentMonth . "\n"; echo $currentYear . "\n"; $month = $currentMonth; $year = $currentYear; $firstDayOfTheMonth = mktime(0, 0, 0, $month, 1, $year); $d = getdate($firstDayOfTheMonth); // Vasarnap helyett hetfo az elso nap a heten. $dayOfTheWeekOfFirstDayOfTheMonth = (6 + $d["wday"]) % 7 + 1; $totalDaysInCurrentMonth = date("t"); $kellenekUresNapokAHonapVegen = true; echo $firstDayOfTheMonth . "firstDayOfTheMonth\n"; echo $d . "d\n"; echo $dayOfTheWeekOfFirstDayOfTheMonth . "dayOfTheWeekOfFirstDayOfTheMonth\n"; echo $totalDaysInCurrentMonth . "totalDaysInCurrentMonth\n"; ?>
Output for 5.4.0 - 7.1.0
12 2012 1354316400firstDayOfTheMonth Notice: Array to string conversion in /in/7F9Ob on line 18 Arrayd 6dayOfTheWeekOfFirstDayOfTheMonth 31totalDaysInCurrentMonth
Output for 4.3.0 - 5.3.29
12 2012 1354316400firstDayOfTheMonth Arrayd 6dayOfTheWeekOfFirstDayOfTheMonth 31totalDaysInCurrentMonth