3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $daysInMonth = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); $errors = array(); for ($year = 1500; $year < 2000; $year++) { for ($month = 1; $month <= 12; $month++) { $monthErrors = 0; for ($day = 1; $day < $daysInMonth[$month]; $day++) { $baseString = sprintf("%4d-%02d-%02d 00:00:00", $year, $month, $day); $timestamp = strtotime($baseString); $roundTrip = date("Y-m-d H:i:s", $timestamp); if ($baseString !== $roundTrip) { $errors[] = "$baseString ($timestamp) $roundTrip"; $monthErrors++; if ($monthErrors > 10) { break 2; } } } } } $resolvedErrors = array(); if (count($errors) > 50) { $errorCount = count($errors); $delta = $errorCount / 50.0; $currentIndex = 0; do { $resolvedErrors[$currentIndex] = $errors[floor($currentIndex)]; $currentIndex += $delta; } while ($currentIndex < $errorCount); } else { $resolvedErrors = $errors; } echo implode("\n", $resolvedErrors);
Output for 4.3.0 - 5.0.5, 5.2.6 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1916-05-01 00:00:00 (-1693700372) 1916-05-01 01:00:00 1937-07-01 00:00:00 (-1025745572) 1937-07-01 00:00:28 1940-05-16 00:00:00 (-935022000) 1940-05-16 01:40:00
Output for 5.1.2 - 5.2.5
1500-01-01 00:00:00 () 1970-01-01 01:00:00 1508-01-01 00:00:00 () 1970-01-01 01:00:00 1516-01-02 00:00:00 () 1970-01-01 01:00:00 1524-01-02 00:00:00 () 1970-01-01 01:00:00 1532-01-03 00:00:00 () 1970-01-01 01:00:00 1540-01-03 00:00:00 () 1970-01-01 01:00:00 1548-01-04 00:00:00 () 1970-01-01 01:00:00 1556-01-04 00:00:00 () 1970-01-01 01:00:00 1564-01-05 00:00:00 () 1970-01-01 01:00:00 1572-01-05 00:00:00 () 1970-01-01 01:00:00 1580-01-06 00:00:00 () 1970-01-01 01:00:00 1588-01-06 00:00:00 () 1970-01-01 01:00:00 1596-01-07 00:00:00 () 1970-01-01 01:00:00 1604-01-07 00:00:00 () 1970-01-01 01:00:00 1612-01-08 00:00:00 () 1970-01-01 01:00:00 1620-01-08 00:00:00 () 1970-01-01 01:00:00 1628-01-09 00:00:00 () 1970-01-01 01:00:00 1636-01-09 00:00:00 () 1970-01-01 01:00:00 1644-01-10 00:00:00 () 1970-01-01 01:00:00 1652-01-10 00:00:00 () 1970-01-01 01:00:00 1660-01-11 00:00:00 () 1970-01-01 01:00:00 1668-01-11 00:00:00 () 1970-01-01 01:00:00 1677-01-01 00:00:00 () 1970-01-01 01:00:00 1685-01-01 00:00:00 () 1970-01-01 01:00:00 1693-01-02 00:00:00 () 1970-01-01 01:00:00 1701-01-02 00:00:00 () 1970-01-01 01:00:00 1709-01-03 00:00:00 () 1970-01-01 01:00:00 1717-01-03 00:00:00 () 1970-01-01 01:00:00 1725-01-04 00:00:00 () 1970-01-01 01:00:00 1733-01-04 00:00:00 () 1970-01-01 01:00:00 1741-01-05 00:00:00 () 1970-01-01 01:00:00 1749-01-05 00:00:00 () 1970-01-01 01:00:00 1757-01-06 00:00:00 () 1970-01-01 01:00:00 1765-01-06 00:00:00 () 1970-01-01 01:00:00 1773-01-07 00:00:00 () 1970-01-01 01:00:00 1781-01-07 00:00:00 () 1970-01-01 01:00:00 1789-01-08 00:00:00 () 1970-01-01 01:00:00 1797-01-08 00:00:00 () 1970-01-01 01:00:00 1805-01-09 00:00:00 () 1970-01-01 01:00:00 1813-01-09 00:00:00 () 1970-01-01 01:00:00 1821-01-10 00:00:00 () 1970-01-01 01:00:00 1829-01-10 00:00:00 () 1970-01-01 01:00:00 1837-01-11 00:00:00 () 1970-01-01 01:00:00 1845-01-11 00:00:00 () 1970-01-01 01:00:00 1854-01-01 00:00:00 () 1970-01-01 01:00:00 1862-01-01 00:00:00 () 1970-01-01 01:00:00 1870-01-02 00:00:00 () 1970-01-01 01:00:00 1878-01-02 00:00:00 () 1970-01-01 01:00:00 1886-01-03 00:00:00 () 1970-01-01 01:00:00 1894-01-03 00:00:00 () 1970-01-01 01:00:00
Output for 5.1.0 - 5.1.1
1500-01-01 00:00:00 () 1970-01-01 01:00:00 1508-01-05 00:00:00 () 1970-01-01 01:00:00 1516-01-09 00:00:00 () 1970-01-01 01:00:00 1525-01-02 00:00:00 () 1970-01-01 01:00:00 1533-01-06 00:00:00 () 1970-01-01 01:00:00 1541-01-11 00:00:00 () 1970-01-01 01:00:00 1550-01-04 00:00:00 () 1970-01-01 01:00:00 1558-01-08 00:00:00 () 1970-01-01 01:00:00 1567-01-01 00:00:00 () 1970-01-01 01:00:00 1575-01-05 00:00:00 () 1970-01-01 01:00:00 1583-01-10 00:00:00 () 1970-01-01 01:00:00 1592-01-03 00:00:00 () 1970-01-01 01:00:00 1600-01-07 00:00:00 () 1970-01-01 01:00:00 1608-01-11 00:00:00 () 1970-01-01 01:00:00 1617-01-04 00:00:00 () 1970-01-01 01:00:00 1625-01-09 00:00:00 () 1970-01-01 01:00:00 1634-01-02 00:00:00 () 1970-01-01 01:00:00 1642-01-06 00:00:00 () 1970-01-01 01:00:00 1650-01-10 00:00:00 () 1970-01-01 01:00:00 1659-01-03 00:00:00 () 1970-01-01 01:00:00 1667-01-08 00:00:00 () 1970-01-01 01:00:00 1676-01-01 00:00:00 () 1970-01-01 01:00:00 1684-01-05 00:00:00 () 1970-01-01 01:00:00 1692-01-09 00:00:00 () 1970-01-01 01:00:00 1701-01-02 00:00:00 () 1970-01-01 01:00:00 1709-01-07 00:00:00 () 1970-01-01 01:00:00 1717-01-11 00:00:00 () 1970-01-01 01:00:00 1726-01-04 00:00:00 () 1970-01-01 01:00:00 1734-01-08 00:00:00 () 1970-01-01 01:00:00 1743-01-01 00:00:00 () 1970-01-01 01:00:00 1751-01-05 00:00:00 () 1970-01-01 01:00:00 1759-01-10 00:00:00 () 1970-01-01 01:00:00 1768-01-03 00:00:00 () 1970-01-01 01:00:00 1776-01-07 00:00:00 () 1970-01-01 01:00:00 1784-01-11 00:00:00 () 1970-01-01 01:00:00 1793-01-04 00:00:00 () 1970-01-01 01:00:00 1801-01-09 00:00:00 () 1970-01-01 01:00:00 1810-01-02 00:00:00 () 1970-01-01 01:00:00 1818-01-06 00:00:00 () 1970-01-01 01:00:00 1826-01-10 00:00:00 () 1970-01-01 01:00:00 1835-01-03 00:00:00 () 1970-01-01 01:00:00 1843-01-08 00:00:00 () 1970-01-01 01:00:00 1852-01-01 00:00:00 () 1970-01-01 01:00:00 1860-01-05 00:00:00 () 1970-01-01 01:00:00 1868-01-09 00:00:00 () 1970-01-01 01:00:00 1877-01-02 00:00:00 () 1970-01-01 01:00:00 1885-01-07 00:00:00 () 1970-01-01 01:00:00 1893-01-11 00:00:00 () 1970-01-01 01:00:00 1904-01-04 00:00:00 (-2082586772) 1904-01-05 00:00:00 1936-01-08 00:00:00 (-1072397972) 1936-01-09 00:00:00 1968-01-11 00:00:00 (-62298000) 1968-01-12 00:00:00