3v4l.org

run code in 200+ php & hhvm versions
<?php $timestamp = strtotime('0000-02-20 00:00:00'); $timestamp2 = strtotime('0001-02-20 00:00:00'); print $timestamp . "\n"; $date_time = date_create('@' . $timestamp); print_r($date_time); print $timestamp2 . "\n"; $date_time2 = date_create('@' . $timestamp2); print_r($date_time2);
based on sgbvY
Output for 7.2.0 - 7.4.0beta4
-62162900372 DateTime Object ( [date] => 0000-02-18 23:40:28.000000 [timezone_type] => 1 [timezone] => +00:00 ) -62131277972 DateTime Object ( [date] => 0001-02-19 23:40:28.000000 [timezone_type] => 1 [timezone] => +00:00 )
Output for 7.1.25 - 7.1.32
-62162900372 DateTime Object ( [date] => 0000-02-19 23:40:28.000000 [timezone_type] => 1 [timezone] => +00:00 ) -62131277972 DateTime Object ( [date] => 0001-02-19 23:40:28.000000 [timezone_type] => 1 [timezone] => +00:00 )