3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('UTC'); $date1 = new DateTime('2015-01-01T12:00:00'); $date2 = new DateTime('2015-01-01T12:01:00'); var_dump($date1 < $date2); $date1->setTimezone(new DateTimeZone('UTC')); $date2->setTimezone(new DateTimeZone('EST')); var_dump($date1 < $date2); $date1->getTimestamp(); $date2->getTimestamp(); var_dump($date1 < $date2);
based on 1e2qu
Output for 5.5.0 - 5.5.9, hhvm-3.12.14 - 3.22.0, 7.0.17 - 7.0.32, 7.1.3 - 7.2.12
bool(true) bool(true) bool(true)
Output for 5.5.10 - 5.6.38, 7.0.0 - 7.0.16, 7.1.0 - 7.1.2
bool(true) bool(false) bool(true)