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); echo $interval->format('%R%a days');
based on AsTlk
Output for 5.3.21 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
-224 days
Output for 7.0.6
-362 days
Output for 7.0.5
-314 days
Output for 7.0.4
-291 days
Output for 7.0.3
-299 days
Output for 7.0.2
-303 days
Output for 7.0.1
-304 days
Output for 7.0.0
-307 days
Output for 5.6.21
-343 days
Output for 5.6.20
-321 days
Output for 5.6.19
-288 days
Output for 5.6.18
-295 days
Output for 5.6.17
-300 days
Output for 5.6.16
-308 days
Output for 5.6.15
-309 days
Output for 5.6.14
-325 days
Output for 5.6.13
-326 days
Output for 5.6.12
-331 days
Output for 5.6.11
-335 days
Output for 5.6.10
-336 days
Output for 5.6.9
-339 days
Output for 5.6.8
-341 days
Output for 5.5.35
-364 days
Output for 5.5.34
-322 days
Output for 5.5.33
-289 days
Output for 5.5.32
-297 days
Output for 5.5.31
-301 days
Output for 5.5.30
-312 days
Output for 5.5.29
-328 days
Output for 5.5.28
-332 days
Output for 5.5.27
-333 days
Output for 5.5.26
-337 days
Output for 5.5.25
-340 days
Output for 5.5.24
-365 days