3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime('2016-01-10 23:30:59'); $start = new DateTime('saturday this week 15:00'); $end = new DateTime('monday next week 08:00'); $departure = new DateTime('2016-01-12 23:30:59'); $diff = (strtotime($departure->format('Y-m-d H:i:s')) - strtotime($now->format('Y-m-d H:i:s')))/3600; echo $diff . PHP_EOL;; echo $now->format('Y-m-d H:i:s'). PHP_EOL; echo $start->format('Y-m-d H:i:s'). PHP_EOL; echo $end->format('Y-m-d H:i:s'). PHP_EOL; if ($now > $start && $now < $end && $diff <= 72) { echo 'Error! Please contact administrator!'; }
based on BkEAA
Output for 5.5.0 - 5.6.30, hhvm-3.10.1, hhvm-3.13.2 - 3.17.3, 7.0.0 - 7.2.0
48 2016-01-10 23:30:59 2016-01-09 15:00:00 2016-01-11 08:00:00 Error! Please contact administrator!
Output for hhvm-3.11.1 - 3.12.14

Process exited with code 137.