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") { $number_of_sundays++; echo "01.".$current_month.".".$current_year." was a Sunday!"."\n"; } } } echo $number_of_sundays;
Output for 4.3.0 - 5.0.5, 5.2.6 - 7.1.0
01.4.1900 was a Sunday! 01.7.1900 was a Sunday! 01.9.1901 was a Sunday! 01.12.1901 was a Sunday! 01.6.1902 was a Sunday! 01.2.1903 was a Sunday! 01.3.1903 was a Sunday! 01.11.1903 was a Sunday! 01.5.1904 was a Sunday! 01.1.1905 was a Sunday! 01.10.1905 was a Sunday! 01.4.1906 was a Sunday! 01.7.1906 was a Sunday! 01.9.1907 was a Sunday! 01.12.1907 was a Sunday! 01.3.1908 was a Sunday! 01.11.1908 was a Sunday! 01.8.1909 was a Sunday! 01.5.1910 was a Sunday! 01.1.1911 was a Sunday! 01.10.1911 was a Sunday! 01.9.1912 was a Sunday! 01.12.1912 was a Sunday! 01.6.1913 was a Sunday! 01.2.1914 was a Sunday! 01.3.1914 was a Sunday! 01.11.1914 was a Sunday! 01.8.1915 was a Sunday! 01.10.1916 was a Sunday! 01.4.1917 was a Sunday! 01.7.1917 was a Sunday! 01.9.1918 was a Sunday! 01.12.1918 was a Sunday! 01.6.1919 was a Sunday! 01.2.1920 was a Sunday! 01.8.1920 was a Sunday! 01.5.1921 was a Sunday! 01.1.1922 was a Sunday! 01.10.1922 was a Sunday! 01.4.1923 was a Sunday! 01.7.1923 was a Sunday! 01.6.1924 was a Sunday! 01.2.1925 was a Sunday! 01.3.1925 was a Sunday! 01.11.1925 was a Sunday! 01.8.1926 was a Sunday! 01.5.1927 was a Sunday! 01.1.1928 was a Sunday! 01.4.1928 was a Sunday! 01.7.1928 was a Sunday! 01.9.1929 was a Sunday! 01.12.1929 was a Sunday! 01.6.1930 was a Sunday! 01.2.1931 was a Sunday! 01.3.1931 was a Sunday! 01.11.1931 was a Sunday! 01.5.1932 was a Sunday! 01.1.1933 was a Sunday! 01.10.1933 was a Sunday! 01.4.1934 was a Sunday! 01.7.1934 was a Sunday! 01.9.1935 was a Sunday! 01.12.1935 was a Sunday! 01.3.1936 was a Sunday! 01.11.1936 was a Sunday! 01.8.1937 was a Sunday! 01.5.1938 was a Sunday! 01.1.1939 was a Sunday! 01.10.1939 was a Sunday! 01.9.1940 was a Sunday! 01.12.1940 was a Sunday! 01.6.1941 was a Sunday! 01.2.1942 was a Sunday! 01.3.1942 was a Sunday! 01.11.1942 was a Sunday! 01.8.1943 was a Sunday! 01.10.1944 was a Sunday! 01.4.1945 was a Sunday! 01.7.1945 was a Sunday! 01.9.1946 was a Sunday! 01.12.1946 was a Sunday! 01.6.1947 was a Sunday! 01.2.1948 was a Sunday! 01.8.1948 was a Sunday! 01.5.1949 was a Sunday! 01.1.1950 was a Sunday! 01.10.1950 was a Sunday! 01.4.1951 was a Sunday! 01.7.1951 was a Sunday! 01.6.1952 was a Sunday! 01.2.1953 was a Sunday! 01.3.1953 was a Sunday! 01.11.1953 was a Sunday! 01.8.1954 was a Sunday! 01.5.1955 was a Sunday! 01.1.1956 was a Sunday! 01.4.1956 was a Sunday! 01.7.1956 was a Sunday! 01.9.1957 was a Sunday! 01.12.1957 was a Sunday! 01.6.1958 was a Sunday! 01.2.1959 was a Sunday! 01.3.1959 was a Sunday! 01.11.1959 was a Sunday! 01.5.1960 was a Sunday! 01.1.1961 was a Sunday! 01.10.1961 was a Sunday! 01.4.1962 was a Sunday! 01.7.1962 was a Sunday! 01.9.1963 was a Sunday! 01.12.1963 was a Sunday! 01.3.1964 was a Sunday! 01.11.1964 was a Sunday! 01.8.1965 was a Sunday! 01.5.1966 was a Sunday! 01.1.1967 was a Sunday! 01.10.1967 was a Sunday! 01.9.1968 was a Sunday! 01.12.1968 was a Sunday! 01.6.1969 was a Sunday! 01.2.1970 was a Sunday! 01.3.1970 was a Sunday! 01.11.1970 was a Sunday! 01.8.1971 was a Sunday! 01.10.1972 was a Sunday! 01.4.1973 was a Sunday! 01.7.1973 was a Sunday! 01.9.1974 was a Sunday! 01.12.1974 was a Sunday! 01.6.1975 was a Sunday! 01.2.1976 was a Sunday! 01.8.1976 was a Sunday! 01.5.1977 was a Sunday! 01.1.1978 was a Sunday! 01.10.1978 was a Sunday! 01.4.1979 was a Sunday! 01.7.1979 was a Sunday! 01.6.1980 was a Sunday! 01.2.1981 was a Sunday! 01.3.1981 was a Sunday! 01.11.1981 was a Sunday! 01.8.1982 was a Sunday! 01.5.1983 was a Sunday! 01.1.1984 was a Sunday! 01.4.1984 was a Sunday! 01.7.1984 was a Sunday! 01.9.1985 was a Sunday! 01.12.1985 was a Sunday! 01.6.1986 was a Sunday! 01.2.1987 was a Sunday! 01.3.1987 was a Sunday! 01.11.1987 was a Sunday! 01.5.1988 was a Sunday! 01.1.1989 was a Sunday! 01.10.1989 was a Sunday! 01.4.1990 was a Sunday! 01.7.1990 was a Sunday! 01.9.1991 was a Sunday! 01.12.1991 was a Sunday! 01.3.1992 was a Sunday! 01.11.1992 was a Sunday! 01.8.1993 was a Sunday! 01.5.1994 was a Sunday! 01.1.1995 was a Sunday! 01.10.1995 was a Sunday! 01.9.1996 was a Sunday! 01.12.1996 was a Sunday! 01.6.1997 was a Sunday! 01.2.1998 was a Sunday! 01.3.1998 was a Sunday! 01.11.1998 was a Sunday! 01.8.1999 was a Sunday! 172
Output for 5.1.2 - 5.2.5
01.6.1902 was a Sunday! 01.2.1903 was a Sunday! 01.3.1903 was a Sunday! 01.11.1903 was a Sunday! 01.5.1904 was a Sunday! 01.1.1905 was a Sunday! 01.10.1905 was a Sunday! 01.4.1906 was a Sunday! 01.7.1906 was a Sunday! 01.9.1907 was a Sunday! 01.12.1907 was a Sunday! 01.3.1908 was a Sunday! 01.11.1908 was a Sunday! 01.8.1909 was a Sunday! 01.5.1910 was a Sunday! 01.1.1911 was a Sunday! 01.10.1911 was a Sunday! 01.9.1912 was a Sunday! 01.12.1912 was a Sunday! 01.6.1913 was a Sunday! 01.2.1914 was a Sunday! 01.3.1914 was a Sunday! 01.11.1914 was a Sunday! 01.8.1915 was a Sunday! 01.10.1916 was a Sunday! 01.4.1917 was a Sunday! 01.7.1917 was a Sunday! 01.9.1918 was a Sunday! 01.12.1918 was a Sunday! 01.6.1919 was a Sunday! 01.2.1920 was a Sunday! 01.8.1920 was a Sunday! 01.5.1921 was a Sunday! 01.1.1922 was a Sunday! 01.10.1922 was a Sunday! 01.4.1923 was a Sunday! 01.7.1923 was a Sunday! 01.6.1924 was a Sunday! 01.2.1925 was a Sunday! 01.3.1925 was a Sunday! 01.11.1925 was a Sunday! 01.8.1926 was a Sunday! 01.5.1927 was a Sunday! 01.1.1928 was a Sunday! 01.4.1928 was a Sunday! 01.7.1928 was a Sunday! 01.9.1929 was a Sunday! 01.12.1929 was a Sunday! 01.6.1930 was a Sunday! 01.2.1931 was a Sunday! 01.3.1931 was a Sunday! 01.11.1931 was a Sunday! 01.5.1932 was a Sunday! 01.1.1933 was a Sunday! 01.10.1933 was a Sunday! 01.4.1934 was a Sunday! 01.7.1934 was a Sunday! 01.9.1935 was a Sunday! 01.12.1935 was a Sunday! 01.3.1936 was a Sunday! 01.11.1936 was a Sunday! 01.8.1937 was a Sunday! 01.5.1938 was a Sunday! 01.1.1939 was a Sunday! 01.10.1939 was a Sunday! 01.9.1940 was a Sunday! 01.12.1940 was a Sunday! 01.6.1941 was a Sunday! 01.2.1942 was a Sunday! 01.3.1942 was a Sunday! 01.11.1942 was a Sunday! 01.8.1943 was a Sunday! 01.10.1944 was a Sunday! 01.4.1945 was a Sunday! 01.7.1945 was a Sunday! 01.9.1946 was a Sunday! 01.12.1946 was a Sunday! 01.6.1947 was a Sunday! 01.2.1948 was a Sunday! 01.8.1948 was a Sunday! 01.5.1949 was a Sunday! 01.1.1950 was a Sunday! 01.10.1950 was a Sunday! 01.4.1951 was a Sunday! 01.7.1951 was a Sunday! 01.6.1952 was a Sunday! 01.2.1953 was a Sunday! 01.3.1953 was a Sunday! 01.11.1953 was a Sunday! 01.8.1954 was a Sunday! 01.5.1955 was a Sunday! 01.1.1956 was a Sunday! 01.4.1956 was a Sunday! 01.7.1956 was a Sunday! 01.9.1957 was a Sunday! 01.12.1957 was a Sunday! 01.6.1958 was a Sunday! 01.2.1959 was a Sunday! 01.3.1959 was a Sunday! 01.11.1959 was a Sunday! 01.5.1960 was a Sunday! 01.1.1961 was a Sunday! 01.10.1961 was a Sunday! 01.4.1962 was a Sunday! 01.7.1962 was a Sunday! 01.9.1963 was a Sunday! 01.12.1963 was a Sunday! 01.3.1964 was a Sunday! 01.11.1964 was a Sunday! 01.8.1965 was a Sunday! 01.5.1966 was a Sunday! 01.1.1967 was a Sunday! 01.10.1967 was a Sunday! 01.9.1968 was a Sunday! 01.12.1968 was a Sunday! 01.6.1969 was a Sunday! 01.2.1970 was a Sunday! 01.3.1970 was a Sunday! 01.11.1970 was a Sunday! 01.8.1971 was a Sunday! 01.10.1972 was a Sunday! 01.4.1973 was a Sunday! 01.7.1973 was a Sunday! 01.9.1974 was a Sunday! 01.12.1974 was a Sunday! 01.6.1975 was a Sunday! 01.2.1976 was a Sunday! 01.8.1976 was a Sunday! 01.5.1977 was a Sunday! 01.1.1978 was a Sunday! 01.10.1978 was a Sunday! 01.4.1979 was a Sunday! 01.7.1979 was a Sunday! 01.6.1980 was a Sunday! 01.2.1981 was a Sunday! 01.3.1981 was a Sunday! 01.11.1981 was a Sunday! 01.8.1982 was a Sunday! 01.5.1983 was a Sunday! 01.1.1984 was a Sunday! 01.4.1984 was a Sunday! 01.7.1984 was a Sunday! 01.9.1985 was a Sunday! 01.12.1985 was a Sunday! 01.6.1986 was a Sunday! 01.2.1987 was a Sunday! 01.3.1987 was a Sunday! 01.11.1987 was a Sunday! 01.5.1988 was a Sunday! 01.1.1989 was a Sunday! 01.10.1989 was a Sunday! 01.4.1990 was a Sunday! 01.7.1990 was a Sunday! 01.9.1991 was a Sunday! 01.12.1991 was a Sunday! 01.3.1992 was a Sunday! 01.11.1992 was a Sunday! 01.8.1993 was a Sunday! 01.5.1994 was a Sunday! 01.1.1995 was a Sunday! 01.10.1995 was a Sunday! 01.9.1996 was a Sunday! 01.12.1996 was a Sunday! 01.6.1997 was a Sunday! 01.2.1998 was a Sunday! 01.3.1998 was a Sunday! 01.11.1998 was a Sunday! 01.8.1999 was a Sunday! 168
Output for 5.1.0 - 5.1.1
01.6.1902 was a Sunday! 01.2.1903 was a Sunday! 01.3.1903 was a Sunday! 01.11.1903 was a Sunday! 01.10.1904 was a Sunday! 01.1.1905 was a Sunday! 01.10.1905 was a Sunday! 01.4.1906 was a Sunday! 01.7.1906 was a Sunday! 01.9.1907 was a Sunday! 01.12.1907 was a Sunday! 01.2.1908 was a Sunday! 01.8.1908 was a Sunday! 01.8.1909 was a Sunday! 01.5.1910 was a Sunday! 01.1.1911 was a Sunday! 01.10.1911 was a Sunday! 01.6.1912 was a Sunday! 01.6.1913 was a Sunday! 01.2.1914 was a Sunday! 01.3.1914 was a Sunday! 01.11.1914 was a Sunday! 01.8.1915 was a Sunday! 01.1.1916 was a Sunday! 01.4.1916 was a Sunday! 01.7.1916 was a Sunday! 01.4.1917 was a Sunday! 01.7.1917 was a Sunday! 01.9.1918 was a Sunday! 01.12.1918 was a Sunday! 01.6.1919 was a Sunday! 01.5.1920 was a Sunday! 01.5.1921 was a Sunday! 01.1.1922 was a Sunday! 01.10.1922 was a Sunday! 01.4.1923 was a Sunday! 01.7.1923 was a Sunday! 01.3.1924 was a Sunday! 01.11.1924 was a Sunday! 01.2.1925 was a Sunday! 01.3.1925 was a Sunday! 01.11.1925 was a Sunday! 01.8.1926 was a Sunday! 01.5.1927 was a Sunday! 01.9.1928 was a Sunday! 01.12.1928 was a Sunday! 01.9.1929 was a Sunday! 01.12.1929 was a Sunday! 01.6.1930 was a Sunday! 01.2.1931 was a Sunday! 01.3.1931 was a Sunday! 01.11.1931 was a Sunday! 01.10.1932 was a Sunday! 01.1.1933 was a Sunday! 01.10.1933 was a Sunday! 01.4.1934 was a Sunday! 01.7.1934 was a Sunday! 01.9.1935 was a Sunday! 01.12.1935 was a Sunday! 01.2.1936 was a Sunday! 01.8.1936 was a Sunday! 01.8.1937 was a Sunday! 01.5.1938 was a Sunday! 01.1.1939 was a Sunday! 01.10.1939 was a Sunday! 01.6.1940 was a Sunday! 01.6.1941 was a Sunday! 01.2.1942 was a Sunday! 01.3.1942 was a Sunday! 01.11.1942 was a Sunday! 01.8.1943 was a Sunday! 01.1.1944 was a Sunday! 01.4.1944 was a Sunday! 01.7.1944 was a Sunday! 01.4.1945 was a Sunday! 01.7.1945 was a Sunday! 01.9.1946 was a Sunday! 01.12.1946 was a Sunday! 01.6.1947 was a Sunday! 01.5.1948 was a Sunday! 01.5.1949 was a Sunday! 01.1.1950 was a Sunday! 01.10.1950 was a Sunday! 01.4.1951 was a Sunday! 01.7.1951 was a Sunday! 01.3.1952 was a Sunday! 01.11.1952 was a Sunday! 01.2.1953 was a Sunday! 01.3.1953 was a Sunday! 01.11.1953 was a Sunday! 01.8.1954 was a Sunday! 01.5.1955 was a Sunday! 01.9.1956 was a Sunday! 01.12.1956 was a Sunday! 01.9.1957 was a Sunday! 01.12.1957 was a Sunday! 01.6.1958 was a Sunday! 01.2.1959 was a Sunday! 01.3.1959 was a Sunday! 01.11.1959 was a Sunday! 01.10.1960 was a Sunday! 01.1.1961 was a Sunday! 01.10.1961 was a Sunday! 01.4.1962 was a Sunday! 01.7.1962 was a Sunday! 01.9.1963 was a Sunday! 01.12.1963 was a Sunday! 01.2.1964 was a Sunday! 01.8.1964 was a Sunday! 01.8.1965 was a Sunday! 01.5.1966 was a Sunday! 01.1.1967 was a Sunday! 01.10.1967 was a Sunday! 01.6.1968 was a Sunday! 01.6.1969 was a Sunday! 01.2.1970 was a Sunday! 01.3.1970 was a Sunday! 01.11.1970 was a Sunday! 01.8.1971 was a Sunday! 01.10.1972 was a Sunday! 01.4.1973 was a Sunday! 01.7.1973 was a Sunday! 01.9.1974 was a Sunday! 01.12.1974 was a Sunday! 01.6.1975 was a Sunday! 01.2.1976 was a Sunday! 01.8.1976 was a Sunday! 01.5.1977 was a Sunday! 01.1.1978 was a Sunday! 01.10.1978 was a Sunday! 01.4.1979 was a Sunday! 01.7.1979 was a Sunday! 01.6.1980 was a Sunday! 01.2.1981 was a Sunday! 01.3.1981 was a Sunday! 01.11.1981 was a Sunday! 01.8.1982 was a Sunday! 01.5.1983 was a Sunday! 01.1.1984 was a Sunday! 01.4.1984 was a Sunday! 01.7.1984 was a Sunday! 01.9.1985 was a Sunday! 01.12.1985 was a Sunday! 01.6.1986 was a Sunday! 01.2.1987 was a Sunday! 01.3.1987 was a Sunday! 01.11.1987 was a Sunday! 01.5.1988 was a Sunday! 01.1.1989 was a Sunday! 01.10.1989 was a Sunday! 01.4.1990 was a Sunday! 01.7.1990 was a Sunday! 01.9.1991 was a Sunday! 01.12.1991 was a Sunday! 01.3.1992 was a Sunday! 01.11.1992 was a Sunday! 01.8.1993 was a Sunday! 01.5.1994 was a Sunday! 01.1.1995 was a Sunday! 01.10.1995 was a Sunday! 01.9.1996 was a Sunday! 01.12.1996 was a Sunday! 01.6.1997 was a Sunday! 01.2.1998 was a Sunday! 01.3.1998 was a Sunday! 01.11.1998 was a Sunday! 01.8.1999 was a Sunday! 167