3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datetime1 = new DateTime(); $datetime2 = new DateTime('2013-02-03 19:13:00'); $interval = $datetime1->diff($datetime2); echo $interval->format('%h hours %i minutes'); ?>
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.29, 5.6.28, 7.0.14 - 7.1.0
5 hours 30 minutes
Output for 7.0.6
13 hours 52 minutes
Output for 7.0.5
2 hours 45 minutes
Output for 7.0.4
13 hours 12 minutes
Output for 7.0.3
13 hours 47 minutes
Output for 7.0.2
19 hours 33 minutes
Output for 7.0.1
0 hours 31 minutes
Output for 7.0.0
2 hours 5 minutes
Output for 5.6.21
9 hours 12 minutes
Output for 5.6.20
1 hours 40 minutes
Output for 5.6.19
21 hours 20 minutes
Output for 5.6.18
5 hours 7 minutes
Output for 5.6.17
18 hours 4 minutes
Output for 5.6.16
3 hours 50 minutes
Output for 5.6.15
4 hours 43 minutes
Output for 5.6.14
7 hours 18 minutes
Output for 5.6.13
11 hours 12 minutes
Output for 5.6.12
0 hours 53 minutes
Output for 5.6.11
7 hours 59 minutes
Output for 5.6.10
9 hours 42 minutes
Output for 5.6.9
14 hours 40 minutes
Output for 5.6.8
22 hours 44 minutes
Output for 5.5.35
12 hours 57 minutes
Output for 5.5.34
4 hours 2 minutes
Output for 5.5.33
0 hours 17 minutes
Output for 5.5.32
6 hours 58 minutes
Output for 5.5.31
20 hours 50 minutes
Output for 5.5.30
6 hours 51 minutes
Output for 5.5.29
1 hours 17 minutes
Output for 5.5.28
3 hours 59 minutes
Output for 5.5.27
6 hours 29 minutes
Output for 5.5.26
12 hours 9 minutes
Output for 5.5.25
18 hours 14 minutes
Output for 5.5.24
1 hours 28 minutes
Output for 5.4.41 - 5.4.45
8 hours 38 minutes
Output for 5.4.39 - 5.4.40
8 hours 37 minutes
Output for 5.4.38
3 hours 52 minutes
Output for 5.4.34 - 5.4.37
3 hours 51 minutes
Output for 5.3.29, 5.4.30 - 5.4.32
21 hours 36 minutes
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/hGEqJ on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/hGEqJ 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/hGEqJ 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/hGEqJ on line 2