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 = $now->diff( $pickUpDateTime );; echo ($interval->d);
based on BicUF
Output for 5.3.21 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
10
Output for 5.5.28, 5.5.31, 7.0.6
27
Output for 7.0.5
9
Output for 5.5.34, 7.0.4
17
Output for 7.0.3
25
Output for 5.5.35, 7.0.2
29
Output for 5.5.24, 5.6.11, 7.0.1
30
Output for 7.0.0
2
Output for 5.6.21
8
Output for 5.6.20
16
Output for 5.6.19
14
Output for 5.6.13, 5.6.18
21
Output for 5.6.12, 5.6.17
26
Output for 5.6.9, 5.6.16
3
Output for 5.5.25, 5.6.15
4
Output for 5.6.14
20
Output for 5.6.10
0
Output for 5.6.8
5
Output for 5.5.33
15
Output for 5.5.29, 5.5.32
23
Output for 5.5.30
7
Output for 5.5.27
28
Output for 5.5.26
1