3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $eastern = new \DateTimeZone( 'America/New_York' ); $time = new \DateTime( 'now', $eastern ); $ad_active_time_start = new \DateTime( 'December 18, 2015 9:00am', $eastern ); $ad_active_time_end = new \DateTime( 'December 19, 2015 10:00am', $eastern ); var_dump( $time > $ad_active_time_start ); var_dump( $ad_active_time_end > $ad_active_time_start ); echo $ad_active_time_end - $ad_active_time_start;
based on j9nOt
Output for 7.3.0alpha1
bool(false) bool(true) Notice: Object of class DateTime could not be converted to number in /in/Kb3T9 on line 9 Notice: Object of class DateTime could not be converted to number in /in/Kb3T9 on line 9 0
Output for 5.3.20 - 5.4.45, 5.6.28, 7.0.20 - 7.2.6
bool(false) bool(true) Notice: Object of class DateTime could not be converted to int in /in/Kb3T9 on line 9 Notice: Object of class DateTime could not be converted to int in /in/Kb3T9 on line 9 0
Output for 5.5.24 - 5.6.21, 7.0.0 - 7.0.6
bool(true) bool(true) Notice: Object of class DateTime could not be converted to int in /in/Kb3T9 on line 9 Notice: Object of class DateTime could not be converted to int in /in/Kb3T9 on line 9 0