3v4l.org

run code in 200+ 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('%d day %h hours %i minutes');
Output for 7.0.12 - 7.3.0rc4
16 day 17 hours 59 minutes
Output for 7.0.6
17 day 20 hours 30 minutes
Output for 7.0.5
27 day 16 hours 12 minutes
Output for 7.0.4
7 day 4 hours 23 minutes
Output for 7.0.3
15 day 6 hours 18 minutes
Output for 7.0.2
19 day 12 hours 13 minutes
Output for 7.0.1
20 day 15 hours 12 minutes
Output for 7.0.0
23 day 16 hours 58 minutes
Output for 5.6.21
26 day 23 hours 8 minutes
Output for 5.6.20
6 day 15 hours 15 minutes
Output for 5.6.19
4 day 12 hours 35 minutes
Output for 5.6.18
11 day 21 hours 41 minutes
Output for 5.6.17
16 day 9 hours 19 minutes
Output for 5.6.16
24 day 17 hours 47 minutes
Output for 5.6.15
25 day 18 hours 36 minutes
Output for 5.6.14
11 day 0 hours 20 minutes
Output for 5.6.13
12 day 1 hours 3 minutes
Output for 5.6.12
16 day 16 hours 0 minutes
Output for 5.6.11
20 day 21 hours 59 minutes
Output for 5.6.10
22 day 0 hours 5 minutes
Output for 5.6.9
24 day 5 hours 41 minutes
Output for 5.6.8
26 day 13 hours 57 minutes
Output for 5.5.35
19 day 11 hours 2 minutes
Output for 5.5.34
7 day 17 hours 28 minutes
Output for 5.5.33
5 day 15 hours 43 minutes
Output for 5.5.32
14 day 1 hours 42 minutes
Output for 5.5.31
17 day 12 hours 34 minutes
Output for 5.5.30
25 day 20 hours 26 minutes
Output for 5.5.29
13 day 15 hours 15 minutes
Output for 5.5.28
17 day 18 hours 54 minutes
Output for 5.5.27
18 day 20 hours 27 minutes
Output for 5.5.26
23 day 2 hours 48 minutes
Output for 5.5.25
25 day 10 hours 18 minutes
Output for 5.5.24
20 day 17 hours 4 minutes
Output for 5.3.0 - 5.4.45
14 day 13 hours 38 minutes
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/Ht5ME on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Ht5ME 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/Ht5ME 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/Ht5ME on line 2