3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $prev = "2015-12-13"; $prev1 = new DateTime($prev); $today = new DateTime(); $date = $today->diff($prev1); echo $date->format("%r%a");
Output for 5.3.19 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
29
Output for 7.0.6
-142
Output for 7.0.5
-112
Output for 7.0.4
-88
Output for 7.0.3
-96
Output for 7.0.2
-101
Output for 7.0.1
-102
Output for 7.0.0
-105
Output for 5.6.21
-141
Output for 5.6.20
-119
Output for 5.6.19
-86
Output for 5.6.18
-93
Output for 5.6.17
-97
Output for 5.6.16
-106
Output for 5.6.15
-107
Output for 5.6.14
-111
Output for 5.6.13
-124
Output for 5.6.12
-129
Output for 5.6.11
-133
Output for 5.6.10
-134
Output for 5.6.9
-136
Output for 5.6.8
-139
Output for 5.5.35
-161
Output for 5.5.34
-120
Output for 5.5.33
-87
Output for 5.5.32
-95
Output for 5.5.31
-99
Output for 5.5.30
-110
Output for 5.5.29
-126
Output for 5.5.28
-130
Output for 5.5.27
-131
Output for 5.5.26
-135
Output for 5.5.25
-138
Output for 5.5.24
-163