3v4l.org

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