3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $datetime1 = date_create(); $datetime2 = date_create('2015-12-11'); $interval = date_diff($datetime1, $datetime2); echo $interval->format('%R%a days');
based on tupuf
Output for 5.3.20 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
+1 days
Output for 7.0.6
-144 days
Output for 7.0.5
-114 days
Output for 7.0.4
-90 days
Output for 7.0.3
-98 days
Output for 7.0.2
-103 days
Output for 7.0.1
-104 days
Output for 7.0.0
-107 days
Output for 5.6.21
-143 days
Output for 5.6.20
-121 days
Output for 5.6.19
-88 days
Output for 5.6.18
-95 days
Output for 5.6.17
-100 days
Output for 5.6.16
-108 days
Output for 5.6.15
-109 days
Output for 5.6.14
-125 days
Output for 5.6.13
-126 days
Output for 5.6.12
-131 days
Output for 5.6.11
-135 days
Output for 5.6.10
-136 days
Output for 5.6.9
-138 days
Output for 5.6.8
-141 days
Output for 5.5.35
-164 days
Output for 5.5.34
-122 days
Output for 5.5.33
-89 days
Output for 5.5.32
-97 days
Output for 5.5.31
-101 days
Output for 5.5.30
-112 days
Output for 5.5.29
-128 days
Output for 5.5.28
-132 days
Output for 5.5.27
-133 days
Output for 5.5.26
-137 days
Output for 5.5.25
-140 days
Output for 5.5.24
-165 days