3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datetime1 = new DateTime(); $datetime2 = new DateTime('2012-12-01 10:30:00'); $interval = $datetime1->diff($datetime2); $elapsed = $interval->format('%y years, %m months, %a days, %h hours, %i minutes, %S seconds'); echo $elapsed;
based on BG7Hs
Output for 5.6.28, 7.0.14 - 7.1.0
1 years, 9 months, 641 days, 3 hours, 20 minutes, 14 seconds
Output for 7.0.6
3 years, 5 months, 1267 days, 9 hours, 15 minutes, 24 seconds
Output for 7.0.5
3 years, 4 months, 1218 days, 10 hours, 16 minutes, 58 seconds
Output for 7.0.4
3 years, 3 months, 1194 days, 20 hours, 30 minutes, 59 seconds
Output for 7.0.3
3 years, 3 months, 1202 days, 21 hours, 1 minutes, 56 seconds
Output for 7.0.2
3 years, 3 months, 1207 days, 2 hours, 47 minutes, 24 seconds
Output for 7.0.1
3 years, 3 months, 1208 days, 7 hours, 50 minutes, 52 seconds
Output for 7.0.0
3 years, 3 months, 1211 days, 9 hours, 31 minutes, 48 seconds
Output for hhvm-3.12.0
3 years, 3 months, 1196 days, 6 hours, 11 minutes, 06 seconds
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
3 years, 5 months, 1248 days, 11 hours, 11 minutes, 04 seconds
Output for 5.6.20
3 years, 4 months, 1226 days, 2 hours, 56 minutes, 09 seconds
Output for 5.6.19
3 years, 3 months, 1192 days, 4 hours, 35 minutes, 34 seconds
Output for 5.6.18
3 years, 3 months, 1199 days, 12 hours, 11 minutes, 24 seconds
Output for 5.6.17
3 years, 3 months, 1204 days, 1 hours, 20 minutes, 55 seconds
Output for 5.6.16
3 years, 3 months, 1212 days, 11 hours, 17 minutes, 04 seconds
Output for 5.6.15
3 years, 3 months, 1213 days, 12 hours, 10 minutes, 40 seconds
Output for 5.6.14
3 years, 4 months, 1217 days, 14 hours, 45 minutes, 10 seconds
Output for 5.6.13
3 years, 4 months, 1231 days, 11 hours, 19 minutes, 36 seconds
Output for 5.6.12
3 years, 4 months, 1236 days, 2 hours, 22 minutes, 09 seconds
Output for 5.6.11
3 years, 4 months, 1240 days, 8 hours, 16 minutes, 36 seconds
Output for 5.6.10
3 years, 4 months, 1241 days, 10 hours, 24 minutes, 52 seconds
Output for 5.6.9
3 years, 4 months, 1243 days, 16 hours, 23 minutes, 31 seconds
Output for 5.6.8
3 years, 4 months, 1246 days, 0 hours, 9 minutes, 33 seconds
Output for 5.5.35
3 years, 5 months, 1269 days, 0 hours, 35 minutes, 17 seconds
Output for 5.5.34
3 years, 4 months, 1227 days, 5 hours, 13 minutes, 03 seconds
Output for 5.5.33
3 years, 3 months, 1193 days, 7 hours, 25 minutes, 09 seconds
Output for 5.5.32
3 years, 3 months, 1201 days, 14 hours, 10 minutes, 44 seconds
Output for 5.5.31
3 years, 3 months, 1205 days, 4 hours, 8 minutes, 28 seconds
Output for 5.5.30
3 years, 3 months, 1216 days, 14 hours, 18 minutes, 35 seconds
Output for 5.5.29
3 years, 4 months, 1233 days, 1 hours, 29 minutes, 25 seconds
Output for 5.5.28
3 years, 4 months, 1237 days, 5 hours, 11 minutes, 12 seconds
Output for 5.5.27
3 years, 4 months, 1238 days, 6 hours, 42 minutes, 14 seconds
Output for 5.5.26
3 years, 4 months, 1242 days, 13 hours, 6 minutes, 26 seconds
Output for 5.5.25
3 years, 4 months, 1244 days, 20 hours, 41 minutes, 29 seconds
Output for 5.5.24
3 years, 5 months, 1270 days, 3 hours, 48 minutes, 33 seconds
Output for 5.4.45
2 years, 9 months, 1025 days, 18 hours, 26 minutes, 22 seconds
Output for 5.4.44
2 years, 9 months, 1025 days, 18 hours, 26 minutes, 21 seconds
Output for 5.4.43
2 years, 9 months, 1024 days, 2 hours, 37 minutes, 55 seconds
Output for 5.4.42
2 years, 9 months, 1024 days, 2 hours, 37 minutes, 53 seconds
Output for 5.4.41
2 years, 9 months, 1024 days, 2 hours, 37 minutes, 50 seconds
Output for 5.4.40
2 years, 9 months, 1024 days, 2 hours, 37 minutes, 47 seconds
Output for 5.4.39
2 years, 9 months, 1024 days, 2 hours, 37 minutes, 44 seconds
Output for 5.4.38
2 years, 3 months, 833 days, 6 hours, 11 minutes, 45 seconds
Output for 5.4.36 - 5.4.37
2 years, 3 months, 833 days, 6 hours, 11 minutes, 38 seconds
Output for 5.4.34 - 5.4.35
2 years, 3 months, 833 days, 6 hours, 11 minutes, 37 seconds
Output for 5.4.27 - 5.4.32
1 years, 9 months, 641 days, 3 hours, 20 minutes, 17 seconds
Output for 5.4.7 - 5.4.26
1 years, 9 months, 641 days, 3 hours, 20 minutes, 18 seconds
Output for 5.3.17 - 5.4.6
1 years, 9 months, 641 days, 3 hours, 20 minutes, 19 seconds
Output for 5.3.0 - 5.3.16
1 years, 9 months, 641 days, 3 hours, 20 minutes, 20 seconds
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/ELTM2 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/ELTM2 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/ELTM2 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/ELTM2 on line 2