3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $datetime1 = new DateTime(); $datetime2 = new DateTime('2015-02-03 19:13:00'); $interval = $datetime1->diff($datetime2); echo $interval->format('%h hours %i minutes');
based on ZfLO6
Output for 5.3.19 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
1 hours 18 minutes
Output for 7.0.6
22 hours 47 minutes
Output for 7.0.5
11 hours 14 minutes
Output for 7.0.4
23 hours 0 minutes
Output for 7.0.3
0 hours 3 minutes
Output for 7.0.2
6 hours 12 minutes
Output for 7.0.1
9 hours 56 minutes
Output for 7.0.0
11 hours 52 minutes
Output for 5.6.21
17 hours 58 minutes
Output for 5.6.20
10 hours 14 minutes
Output for 5.6.19
7 hours 10 minutes
Output for 5.6.18
15 hours 52 minutes
Output for 5.6.17
3 hours 33 minutes
Output for 5.6.16
12 hours 39 minutes
Output for 5.6.15
13 hours 30 minutes
Output for 5.6.14
15 hours 23 minutes
Output for 5.6.13
19 hours 44 minutes
Output for 5.6.12
10 hours 13 minutes
Output for 5.6.11
16 hours 29 minutes
Output for 5.6.10
18 hours 38 minutes
Output for 5.6.9
23 hours 48 minutes
Output for 5.6.8
8 hours 41 minutes
Output for 5.5.35
0 hours 23 minutes
Output for 5.5.34
12 hours 26 minutes
Output for 5.5.33
9 hours 48 minutes
Output for 5.5.32
19 hours 30 minutes
Output for 5.5.31
6 hours 32 minutes
Output for 5.5.30
15 hours 24 minutes
Output for 5.5.29
10 hours 8 minutes
Output for 5.5.28
13 hours 26 minutes
Output for 5.5.27
15 hours 15 minutes
Output for 5.5.26
21 hours 21 minutes
Output for 5.5.25
4 hours 12 minutes
Output for 5.5.24
21 hours 4 minutes