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 ($current_year = 1900; $current_year <= 1999; $current_year++) { //Make the following actions for all months from January to December for ($current_month = 1; $current_month <= 12; $current_month++) { // Get Unix Timestamp of the current month and year on the first day of the month $current_date = mktime(0, 0, 0, $current_month, 01, $current_year); $get_day_of_week = date("D", $current_date); if ($get_day_of_week == "Sun") { echo "01.".$current_month.".".$current_year."was a Sunday!"."\n"; } } }

preferences:
35.41 ms | 402 KiB | 5 Q