3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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"; } } }
Output for 4.3.0 - 5.0.5, 5.2.6 - 7.1.0
0141900was a Sunday! 0171900was a Sunday! 0191901was a Sunday! 01121901was a Sunday! 0161902was a Sunday! 0121903was a Sunday! 0131903was a Sunday! 01111903was a Sunday! 0151904was a Sunday! 0111905was a Sunday! 01101905was a Sunday! 0141906was a Sunday! 0171906was a Sunday! 0191907was a Sunday! 01121907was a Sunday! 0131908was a Sunday! 01111908was a Sunday! 0181909was a Sunday! 0151910was a Sunday! 0111911was a Sunday! 01101911was a Sunday! 0191912was a Sunday! 01121912was a Sunday! 0161913was a Sunday! 0121914was a Sunday! 0131914was a Sunday! 01111914was a Sunday! 0181915was a Sunday! 01101916was a Sunday! 0141917was a Sunday! 0171917was a Sunday! 0191918was a Sunday! 01121918was a Sunday! 0161919was a Sunday! 0121920was a Sunday! 0181920was a Sunday! 0151921was a Sunday! 0111922was a Sunday! 01101922was a Sunday! 0141923was a Sunday! 0171923was a Sunday! 0161924was a Sunday! 0121925was a Sunday! 0131925was a Sunday! 01111925was a Sunday! 0181926was a Sunday! 0151927was a Sunday! 0111928was a Sunday! 0141928was a Sunday! 0171928was a Sunday! 0191929was a Sunday! 01121929was a Sunday! 0161930was a Sunday! 0121931was a Sunday! 0131931was a Sunday! 01111931was a Sunday! 0151932was a Sunday! 0111933was a Sunday! 01101933was a Sunday! 0141934was a Sunday! 0171934was a Sunday! 0191935was a Sunday! 01121935was a Sunday! 0131936was a Sunday! 01111936was a Sunday! 0181937was a Sunday! 0151938was a Sunday! 0111939was a Sunday! 01101939was a Sunday! 0191940was a Sunday! 01121940was a Sunday! 0161941was a Sunday! 0121942was a Sunday! 0131942was a Sunday! 01111942was a Sunday! 0181943was a Sunday! 01101944was a Sunday! 0141945was a Sunday! 0171945was a Sunday! 0191946was a Sunday! 01121946was a Sunday! 0161947was a Sunday! 0121948was a Sunday! 0181948was a Sunday! 0151949was a Sunday! 0111950was a Sunday! 01101950was a Sunday! 0141951was a Sunday! 0171951was a Sunday! 0161952was a Sunday! 0121953was a Sunday! 0131953was a Sunday! 01111953was a Sunday! 0181954was a Sunday! 0151955was a Sunday! 0111956was a Sunday! 0141956was a Sunday! 0171956was a Sunday! 0191957was a Sunday! 01121957was a Sunday! 0161958was a Sunday! 0121959was a Sunday! 0131959was a Sunday! 01111959was a Sunday! 0151960was a Sunday! 0111961was a Sunday! 01101961was a Sunday! 0141962was a Sunday! 0171962was a Sunday! 0191963was a Sunday! 01121963was a Sunday! 0131964was a Sunday! 01111964was a Sunday! 0181965was a Sunday! 0151966was a Sunday! 0111967was a Sunday! 01101967was a Sunday! 0191968was a Sunday! 01121968was a Sunday! 0161969was a Sunday! 0121970was a Sunday! 0131970was a Sunday! 01111970was a Sunday! 0181971was a Sunday! 01101972was a Sunday! 0141973was a Sunday! 0171973was a Sunday! 0191974was a Sunday! 01121974was a Sunday! 0161975was a Sunday! 0121976was a Sunday! 0181976was a Sunday! 0151977was a Sunday! 0111978was a Sunday! 01101978was a Sunday! 0141979was a Sunday! 0171979was a Sunday! 0161980was a Sunday! 0121981was a Sunday! 0131981was a Sunday! 01111981was a Sunday! 0181982was a Sunday! 0151983was a Sunday! 0111984was a Sunday! 0141984was a Sunday! 0171984was a Sunday! 0191985was a Sunday! 01121985was a Sunday! 0161986was a Sunday! 0121987was a Sunday! 0131987was a Sunday! 01111987was a Sunday! 0151988was a Sunday! 0111989was a Sunday! 01101989was a Sunday! 0141990was a Sunday! 0171990was a Sunday! 0191991was a Sunday! 01121991was a Sunday! 0131992was a Sunday! 01111992was a Sunday! 0181993was a Sunday! 0151994was a Sunday! 0111995was a Sunday! 01101995was a Sunday! 0191996was a Sunday! 01121996was a Sunday! 0161997was a Sunday! 0121998was a Sunday! 0131998was a Sunday! 01111998was a Sunday! 0181999was a Sunday!
Output for 5.1.2 - 5.2.5
0161902was a Sunday! 0121903was a Sunday! 0131903was a Sunday! 01111903was a Sunday! 0151904was a Sunday! 0111905was a Sunday! 01101905was a Sunday! 0141906was a Sunday! 0171906was a Sunday! 0191907was a Sunday! 01121907was a Sunday! 0131908was a Sunday! 01111908was a Sunday! 0181909was a Sunday! 0151910was a Sunday! 0111911was a Sunday! 01101911was a Sunday! 0191912was a Sunday! 01121912was a Sunday! 0161913was a Sunday! 0121914was a Sunday! 0131914was a Sunday! 01111914was a Sunday! 0181915was a Sunday! 01101916was a Sunday! 0141917was a Sunday! 0171917was a Sunday! 0191918was a Sunday! 01121918was a Sunday! 0161919was a Sunday! 0121920was a Sunday! 0181920was a Sunday! 0151921was a Sunday! 0111922was a Sunday! 01101922was a Sunday! 0141923was a Sunday! 0171923was a Sunday! 0161924was a Sunday! 0121925was a Sunday! 0131925was a Sunday! 01111925was a Sunday! 0181926was a Sunday! 0151927was a Sunday! 0111928was a Sunday! 0141928was a Sunday! 0171928was a Sunday! 0191929was a Sunday! 01121929was a Sunday! 0161930was a Sunday! 0121931was a Sunday! 0131931was a Sunday! 01111931was a Sunday! 0151932was a Sunday! 0111933was a Sunday! 01101933was a Sunday! 0141934was a Sunday! 0171934was a Sunday! 0191935was a Sunday! 01121935was a Sunday! 0131936was a Sunday! 01111936was a Sunday! 0181937was a Sunday! 0151938was a Sunday! 0111939was a Sunday! 01101939was a Sunday! 0191940was a Sunday! 01121940was a Sunday! 0161941was a Sunday! 0121942was a Sunday! 0131942was a Sunday! 01111942was a Sunday! 0181943was a Sunday! 01101944was a Sunday! 0141945was a Sunday! 0171945was a Sunday! 0191946was a Sunday! 01121946was a Sunday! 0161947was a Sunday! 0121948was a Sunday! 0181948was a Sunday! 0151949was a Sunday! 0111950was a Sunday! 01101950was a Sunday! 0141951was a Sunday! 0171951was a Sunday! 0161952was a Sunday! 0121953was a Sunday! 0131953was a Sunday! 01111953was a Sunday! 0181954was a Sunday! 0151955was a Sunday! 0111956was a Sunday! 0141956was a Sunday! 0171956was a Sunday! 0191957was a Sunday! 01121957was a Sunday! 0161958was a Sunday! 0121959was a Sunday! 0131959was a Sunday! 01111959was a Sunday! 0151960was a Sunday! 0111961was a Sunday! 01101961was a Sunday! 0141962was a Sunday! 0171962was a Sunday! 0191963was a Sunday! 01121963was a Sunday! 0131964was a Sunday! 01111964was a Sunday! 0181965was a Sunday! 0151966was a Sunday! 0111967was a Sunday! 01101967was a Sunday! 0191968was a Sunday! 01121968was a Sunday! 0161969was a Sunday! 0121970was a Sunday! 0131970was a Sunday! 01111970was a Sunday! 0181971was a Sunday! 01101972was a Sunday! 0141973was a Sunday! 0171973was a Sunday! 0191974was a Sunday! 01121974was a Sunday! 0161975was a Sunday! 0121976was a Sunday! 0181976was a Sunday! 0151977was a Sunday! 0111978was a Sunday! 01101978was a Sunday! 0141979was a Sunday! 0171979was a Sunday! 0161980was a Sunday! 0121981was a Sunday! 0131981was a Sunday! 01111981was a Sunday! 0181982was a Sunday! 0151983was a Sunday! 0111984was a Sunday! 0141984was a Sunday! 0171984was a Sunday! 0191985was a Sunday! 01121985was a Sunday! 0161986was a Sunday! 0121987was a Sunday! 0131987was a Sunday! 01111987was a Sunday! 0151988was a Sunday! 0111989was a Sunday! 01101989was a Sunday! 0141990was a Sunday! 0171990was a Sunday! 0191991was a Sunday! 01121991was a Sunday! 0131992was a Sunday! 01111992was a Sunday! 0181993was a Sunday! 0151994was a Sunday! 0111995was a Sunday! 01101995was a Sunday! 0191996was a Sunday! 01121996was a Sunday! 0161997was a Sunday! 0121998was a Sunday! 0131998was a Sunday! 01111998was a Sunday! 0181999was a Sunday!
Output for 5.1.0 - 5.1.1
0161902was a Sunday! 0121903was a Sunday! 0131903was a Sunday! 01111903was a Sunday! 01101904was a Sunday! 0111905was a Sunday! 01101905was a Sunday! 0141906was a Sunday! 0171906was a Sunday! 0191907was a Sunday! 01121907was a Sunday! 0121908was a Sunday! 0181908was a Sunday! 0181909was a Sunday! 0151910was a Sunday! 0111911was a Sunday! 01101911was a Sunday! 0161912was a Sunday! 0161913was a Sunday! 0121914was a Sunday! 0131914was a Sunday! 01111914was a Sunday! 0181915was a Sunday! 0111916was a Sunday! 0141916was a Sunday! 0171916was a Sunday! 0141917was a Sunday! 0171917was a Sunday! 0191918was a Sunday! 01121918was a Sunday! 0161919was a Sunday! 0151920was a Sunday! 0151921was a Sunday! 0111922was a Sunday! 01101922was a Sunday! 0141923was a Sunday! 0171923was a Sunday! 0131924was a Sunday! 01111924was a Sunday! 0121925was a Sunday! 0131925was a Sunday! 01111925was a Sunday! 0181926was a Sunday! 0151927was a Sunday! 0191928was a Sunday! 01121928was a Sunday! 0191929was a Sunday! 01121929was a Sunday! 0161930was a Sunday! 0121931was a Sunday! 0131931was a Sunday! 01111931was a Sunday! 01101932was a Sunday! 0111933was a Sunday! 01101933was a Sunday! 0141934was a Sunday! 0171934was a Sunday! 0191935was a Sunday! 01121935was a Sunday! 0121936was a Sunday! 0181936was a Sunday! 0181937was a Sunday! 0151938was a Sunday! 0111939was a Sunday! 01101939was a Sunday! 0161940was a Sunday! 0161941was a Sunday! 0121942was a Sunday! 0131942was a Sunday! 01111942was a Sunday! 0181943was a Sunday! 0111944was a Sunday! 0141944was a Sunday! 0171944was a Sunday! 0141945was a Sunday! 0171945was a Sunday! 0191946was a Sunday! 01121946was a Sunday! 0161947was a Sunday! 0151948was a Sunday! 0151949was a Sunday! 0111950was a Sunday! 01101950was a Sunday! 0141951was a Sunday! 0171951was a Sunday! 0131952was a Sunday! 01111952was a Sunday! 0121953was a Sunday! 0131953was a Sunday! 01111953was a Sunday! 0181954was a Sunday! 0151955was a Sunday! 0191956was a Sunday! 01121956was a Sunday! 0191957was a Sunday! 01121957was a Sunday! 0161958was a Sunday! 0121959was a Sunday! 0131959was a Sunday! 01111959was a Sunday! 01101960was a Sunday! 0111961was a Sunday! 01101961was a Sunday! 0141962was a Sunday! 0171962was a Sunday! 0191963was a Sunday! 01121963was a Sunday! 0121964was a Sunday! 0181964was a Sunday! 0181965was a Sunday! 0151966was a Sunday! 0111967was a Sunday! 01101967was a Sunday! 0161968was a Sunday! 0161969was a Sunday! 0121970was a Sunday! 0131970was a Sunday! 01111970was a Sunday! 0181971was a Sunday! 01101972was a Sunday! 0141973was a Sunday! 0171973was a Sunday! 0191974was a Sunday! 01121974was a Sunday! 0161975was a Sunday! 0121976was a Sunday! 0181976was a Sunday! 0151977was a Sunday! 0111978was a Sunday! 01101978was a Sunday! 0141979was a Sunday! 0171979was a Sunday! 0161980was a Sunday! 0121981was a Sunday! 0131981was a Sunday! 01111981was a Sunday! 0181982was a Sunday! 0151983was a Sunday! 0111984was a Sunday! 0141984was a Sunday! 0171984was a Sunday! 0191985was a Sunday! 01121985was a Sunday! 0161986was a Sunday! 0121987was a Sunday! 0131987was a Sunday! 01111987was a Sunday! 0151988was a Sunday! 0111989was a Sunday! 01101989was a Sunday! 0141990was a Sunday! 0171990was a Sunday! 0191991was a Sunday! 01121991was a Sunday! 0131992was a Sunday! 01111992was a Sunday! 0181993was a Sunday! 0151994was a Sunday! 0111995was a Sunday! 01101995was a Sunday! 0191996was a Sunday! 01121996was a Sunday! 0161997was a Sunday! 0121998was a Sunday! 0131998was a Sunday! 01111998was a Sunday! 0181999was a Sunday!