3v4l.org

run code in 300+ PHP versions simultaneously
<?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;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
bool(false) bool(true) Fatal error: Uncaught TypeError: Unsupported operand types: DateTime - DateTime in /in/Kb3T9:9 Stack trace: #0 {main} thrown in /in/Kb3T9 on line 9
Process exited with code 255.
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
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 7.3.32 - 7.3.33
bool(false) bool(true) 0
Output for 5.6.28, 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
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.5.35, 5.6.8 - 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

preferences:
199.21 ms | 402 KiB | 229 Q