3v4l.org

run code in 300+ PHP versions simultaneously
<?php // In the beginning there are no Sundays counted yet $number_of_sundays = 0; // Make the following actions for all years of the twentieth century for ($year = 1900; $year <= 1999; $year++) { //Make the following actions for all months from January to December for ($month = 1; $month <= 12; $month++) { // Get Unix Timestamp of the current month and year on the first day of the month $current_date = mktime(0, 0, 0, $month, 01, $year); $get_day_of_week = date("D", $current_date); echo $year . ", " . $month . ": " . $get_day_of_week. "|" . $current_date . "\n"; } }

preferences:
40.55 ms | 402 KiB | 5 Q