3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime('2015-05-24 00:00:00'); $time = new \DateTime('0000-00-00 21:22:00'); $pickUpDateTime = new \DateTime(); $pickUpDateTime->setDate($date->format('Y'), $date->format('m'), $date->format('d')); $pickUpDateTime->setTime($time->format('H'), $time->format('i'), $time->format('s')); $now = new DateTime("now"); $interval = date_diff($now, $pickUpDateTime); if ( $v = $interval->h >= 1 ) echo ($interval->d*24);
based on 5Mu5g
Output for 5.3.21 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
240
Output for 5.5.28, 5.5.31, 7.0.6
648
Output for 7.0.5
216
Output for 7.0.4
Output for 7.0.3
600
Output for 5.5.35, 7.0.2
696
Output for 5.5.24, 5.6.11, 7.0.1
720
Output for 7.0.0
48
Output for 5.6.21
192
Output for 5.6.20
384
Output for 5.6.19
336
Output for 5.6.13, 5.6.18
504
Output for 5.6.12, 5.6.17
624
Output for 5.6.9, 5.6.16
72
Output for 5.5.25, 5.6.15
96
Output for 5.6.14
480
Output for 5.6.10
0
Output for 5.6.8
120
Output for 5.5.34
408
Output for 5.5.33
360
Output for 5.5.29, 5.5.32
552
Output for 5.5.30
168
Output for 5.5.27
672
Output for 5.5.26
24