3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $datetime1 = new DateTime(); $datetime2 = new DateTime('2016-10-13'); $interval = $datetime1->diff($datetime2); echo $interval->format('%R%a days');
based on J0vZm
Output for 5.3.21 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
+274 days
Output for 7.0.6
+144 days
Output for 7.0.5
+192 days
Output for 7.0.4
+216 days
Output for 7.0.3
+208 days
Output for 7.0.2
+203 days
Output for 7.0.1
+202 days
Output for 7.0.0
+199 days
Output for 5.6.21
+163 days
Output for 5.6.20
+185 days
Output for 5.6.19
+218 days
Output for 5.6.18
+211 days
Output for 5.6.17
+206 days
Output for 5.6.16
+198 days
Output for 5.6.15
+197 days
Output for 5.6.14
+181 days
Output for 5.6.13
+180 days
Output for 5.6.12
+175 days
Output for 5.6.11
+171 days
Output for 5.6.10
+170 days
Output for 5.6.9
+168 days
Output for 5.6.8
+165 days
Output for 5.5.35
+142 days
Output for 5.5.34
+184 days
Output for 5.5.33
+217 days
Output for 5.5.32
+209 days
Output for 5.5.31
+205 days
Output for 5.5.30
+194 days
Output for 5.5.29
+178 days
Output for 5.5.28
+174 days
Output for 5.5.27
+173 days
Output for 5.5.26
+169 days
Output for 5.5.25
+166 days
Output for 5.5.24
+141 days