3v4l.org

run code in 200+ php & hhvm versions
<?php $timestamp = strtotime('0000-02-20 00:00:00 UTC'); $timestamp2 = strtotime('0001-02-20 00:00:00 UTC'); 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 dlYio
Output for 7.2.0 - 7.4.0beta4
-62162899200 DateTime Object ( [date] => 0000-02-19 00:00:00.000000 [timezone_type] => 1 [timezone] => +00:00 ) -62131276800 DateTime Object ( [date] => 0001-02-20 00:00:00.000000 [timezone_type] => 1 [timezone] => +00:00 )
Output for 5.4.30 - 5.4.45, 5.5.14 - 5.6.40, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.1.32
-62162899200 DateTime Object ( [date] => 0000-02-20 00:00:00.000000 [timezone_type] => 1 [timezone] => +00:00 ) -62131276800 DateTime Object ( [date] => 0001-02-20 00:00:00.000000 [timezone_type] => 1 [timezone] => +00:00 )
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.13
-62162899200 DateTime Object ( [date] => 0000-02-20 00:00:00 [timezone_type] => 1 [timezone] => +00:00 ) -62131276800 DateTime Object ( [date] => 0001-02-20 00:00:00 [timezone_type] => 1 [timezone] => +00:00 )
Output for 5.2.10 - 5.2.17
-62162899200 DateTime Object ( ) -62131276800 DateTime Object ( )
Output for 5.2.6 - 5.2.9
-62162899200
Process exited with code 137.
Output for 5.2.4 - 5.2.5
Warning: date_create(): Failed to parse time string (@) at position 0 (@): Unexpected character in /in/TvtuW on line 7 DateTime Object ( ) Warning: date_create(): Failed to parse time string (@) at position 0 (@): Unexpected character in /in/TvtuW on line 11 DateTime Object ( )
Output for 5.2.0 - 5.2.3
Warning: date_create(): Failed to parse time string (@) at position 0 ( in /in/TvtuW on line 7 DateTime Object ( ) Warning: date_create(): Failed to parse time string (@) at position 0 ( in /in/TvtuW on line 11 DateTime Object ( )
Output for 5.1.0 - 5.1.6
Fatal error: Call to undefined function date_create() in /in/TvtuW on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5
951004800 Fatal error: Call to undefined function date_create() in /in/TvtuW on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
951004800 Fatal error: Call to undefined function: date_create() in /in/TvtuW on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.4
951004800 Fatal error: Call to undefined function: date_create() in /in/TvtuW on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
951004800 Fatal error: Call to undefined function: date_create() in /in/TvtuW on line 7