3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // '2017-04-07 20:15:00' $now = new \DateTime('2017-04-26 06:13:00'); // $interval = $now->diff($reservation->lessonDateTime); // '2017-04-07 15:00:00' $interval = $now->diff(new \DateTime('2017-04-26 18:15:00')); $hours = ($interval->days * 24) + $interval->h + ($interval->i / 60) + ($interval->s / 3600); var_dump($interval->h); var_dump($hours); var_dump($hours <= 12);
based on GfAH7
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0beta1
int(12) float(12.033333333333) bool(false)