3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d1 = new DateTime('@1234'); $d2 = new DateTime('@2345'); print_r($d1); print_r($d2); print_r(max($d1, $d2));
based on pSksK
Output for 5.4.30 - 7.2.0
DateTime Object ( [date] => 1970-01-01 00:20:34.000000 [timezone_type] => 1 [timezone] => +00:00 ) DateTime Object ( [date] => 1970-01-01 00:39:05.000000 [timezone_type] => 1 [timezone] => +00:00 ) DateTime Object ( [date] => 1970-01-01 00:39:05.000000 [timezone_type] => 1 [timezone] => +00:00 )
Output for 5.3.0 - 5.4.29
DateTime Object ( [date] => 1970-01-01 00:20:34 [timezone_type] => 1 [timezone] => +00:00 ) DateTime Object ( [date] => 1970-01-01 00:39:05 [timezone_type] => 1 [timezone] => +00:00 ) DateTime Object ( [date] => 1970-01-01 00:39:05 [timezone_type] => 1 [timezone] => +00:00 )
Output for 5.2.0 - 5.2.17
DateTime Object ( ) DateTime Object ( ) DateTime Object ( )
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/paRQB on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/paRQB on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/paRQB on line 3