3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime; $start = new DateTime('saturday this week 15:00'); $end = new DateTime('monday next week 08:00'); $departure = new DateTime($flSummary[0]['ddt']); echo $now; echo $start; echo $end; if ($now > $start && $now < $end && $departure->diff($now)->hours <= 72) { echo 'Error! Please contact administrator!'; } $now = new DateTimeImmutable; $departure = $now->modify('+42 hours'); echo $now->format('Y-m-d H:i:s') . PHP_EOL; echo $departure->format('Y-m-d H:i:s') . PHP_EOL; echo $now->diff($departure)->format('%h') . PHP_EOL;
based on lDkQl
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: flSummary in /in/ppgdM on line 5 Recoverable fatal error: Object of class DateTime could not be converted to string in /in/ppgdM on line 6
Process exited with code 255.
Output for 5.3.21 - 7.0.20
Notice: Undefined variable: flSummary in /in/ppgdM on line 5 Catchable fatal error: Object of class DateTime could not be converted to string in /in/ppgdM on line 6
Process exited with code 255.