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); for ($year = 1500; $year < 2000; $year++) { for ($month = 1; $month <= 12; $month++) { 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); echo "$baseString ($timestamp) $roundTrip\n"; break; } break; } break; }
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
1500-01-01 00:00:00 (-14831770772) 1500-01-01 00:00:00
Output for 5.1.0 - 5.2.5
1500-01-01 00:00:00 () 1970-01-01 01:00:00