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'); $interval->add($datetime1);
Output for 7.0.14 - 7.1.0
0 hours 20 minutes Fatal error: Uncaught Error: Call to undefined method DateInterval::add() in /in/OPh8Z:6 Stack trace: #0 {main} thrown in /in/OPh8Z on line 6
Process exited with code 255.
Output for 7.0.6
7 hours 10 minutes Fatal error: Uncaught Error: Call to undefined method DateInterval::add() in /in/OPh8Z:6 Stack trace: #0 {main} thrown in /in/OPh8Z on line 6
Process exited with code 255.
Output for 7.0.5
20 hours 27 minutes Fatal error: Uncaught Error: Call to undefined method DateInterval::add() in /in/OPh8Z:6 Stack trace: #0 {main} thrown in /in/OPh8Z on line 6
Process exited with code 255.
Output for 7.0.4
5 hours 57 minutes Fatal error: Uncaught Error: Call to undefined method DateInterval::add() in /in/OPh8Z:6 Stack trace: #0 {main} thrown in /in/OPh8Z on line 6
Process exited with code 255.
Output for 7.0.3
6 hours 7 minutes Fatal error: Uncaught Error: Call to undefined method DateInterval::add() in /in/OPh8Z:6 Stack trace: #0 {main} thrown in /in/OPh8Z on line 6
Process exited with code 255.
Output for 7.0.2
16 hours 42 minutes Fatal error: Uncaught Error: Call to undefined method DateInterval::add() in /in/OPh8Z:6 Stack trace: #0 {main} thrown in /in/OPh8Z on line 6
Process exited with code 255.
Output for 7.0.1
16 hours 55 minutes Fatal error: Uncaught Error: Call to undefined method DateInterval::add() in /in/OPh8Z:6 Stack trace: #0 {main} thrown in /in/OPh8Z on line 6
Process exited with code 255.
Output for 7.0.0
19 hours 24 minutes Fatal error: Uncaught Error: Call to undefined method DateInterval::add() in /in/OPh8Z:6 Stack trace: #0 {main} thrown in /in/OPh8Z on line 6
Process exited with code 255.
Output for hhvm-3.12.0
10 hours 33 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for hhvm-3.10.0
0 hours 25 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.28
0 hours 20 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.21
2 hours 13 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.20
15 hours 39 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.19
4 hours 10 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.18
16 hours 13 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.17
10 hours 36 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.16
21 hours 9 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.15
22 hours 3 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.14
0 hours 41 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.13
4 hours 29 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.12
17 hours 38 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.11
0 hours 54 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.10
2 hours 34 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.9
7 hours 43 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.8
15 hours 19 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.6.7
2 hours 5 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.35
5 hours 34 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.34
21 hours 35 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.33
16 hours 48 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.32
22 hours 30 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.31
13 hours 29 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.30
0 hours 4 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.29
18 hours 36 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.28
20 hours 54 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.27
23 hours 25 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.26
4 hours 52 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.25
11 hours 0 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.5.24
18 hours 30 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.4.44 - 5.4.45
3 hours 10 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.4.41 - 5.4.43
17 hours 25 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.4.39 - 5.4.40
12 hours 55 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.4.38
0 hours 34 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.4.34 - 5.4.37
4 hours 47 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.3.29, 5.4.28 - 5.4.32
0 hours 30 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27
3 hours 11 minutes Fatal error: Call to undefined method DateInterval::add() in /in/OPh8Z on line 6
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/OPh8Z on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/OPh8Z 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/OPh8Z 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/OPh8Z on line 2