3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datetime1 = new DateTime(); $datetime2 = new DateTime('2013-09-05 00:00:00'); $interval = $datetime1->diff($datetime2); $elapsed = $interval->format('%y years, %m months, %d days, %h hours, %i minutes, %S seconds'); echo $elapsed; echo $datetime1;
based on aTmNN
Output for 7.1.0
1 years, 0 months, 1 days, 16 hours, 59 minutes, 12 seconds Recoverable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.28, 7.0.14
1 years, 0 months, 1 days, 16 hours, 59 minutes, 12 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 7.0.6
2 years, 7 months, 28 days, 9 hours, 51 minutes, 08 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 7.0.5
2 years, 6 months, 27 days, 22 hours, 42 minutes, 04 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 7.0.4
2 years, 6 months, 5 days, 9 hours, 15 minutes, 14 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 7.0.3
2 years, 6 months, 13 days, 9 hours, 52 minutes, 55 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 7.0.2
2 years, 6 months, 17 days, 15 hours, 46 minutes, 35 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 7.0.1
2 years, 6 months, 18 days, 20 hours, 30 minutes, 57 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 7.0.0
2 years, 6 months, 21 days, 22 hours, 3 minutes, 42 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.21
2 years, 7 months, 27 days, 5 hours, 12 minutes, 04 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.20
2 years, 7 months, 4 days, 21 hours, 38 minutes, 56 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.19
2 years, 6 months, 2 days, 17 hours, 23 minutes, 13 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.18
2 years, 6 months, 10 days, 1 hours, 19 minutes, 35 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.17
2 years, 6 months, 14 days, 14 hours, 8 minutes, 00 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.16
2 years, 6 months, 22 days, 23 hours, 48 minutes, 53 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.15
2 years, 6 months, 24 days, 0 hours, 54 minutes, 05 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.14
2 years, 6 months, 27 days, 3 hours, 14 minutes, 54 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.13
2 years, 7 months, 10 days, 7 hours, 9 minutes, 35 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.12
2 years, 7 months, 14 days, 20 hours, 54 minutes, 05 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.11
2 years, 7 months, 18 days, 3 hours, 58 minutes, 08 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.10
2 years, 7 months, 20 days, 5 hours, 41 minutes, 57 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.9
2 years, 7 months, 22 days, 10 hours, 39 minutes, 44 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.6.8
2 years, 7 months, 24 days, 18 hours, 44 minutes, 56 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.35
2 years, 8 months, 17 days, 8 hours, 54 minutes, 57 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.34
2 years, 7 months, 5 days, 23 hours, 59 minutes, 06 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.33
2 years, 6 months, 3 days, 20 hours, 20 minutes, 08 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.32
2 years, 6 months, 12 days, 3 hours, 0 minutes, 52 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.31
2 years, 6 months, 15 days, 16 hours, 53 minutes, 51 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.30
2 years, 6 months, 26 days, 2 hours, 49 minutes, 48 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.29
2 years, 7 months, 11 days, 21 hours, 14 minutes, 48 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.28
2 years, 7 months, 15 days, 23 hours, 59 minutes, 13 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.27
2 years, 7 months, 17 days, 2 hours, 28 minutes, 57 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.26
2 years, 7 months, 21 days, 8 hours, 8 minutes, 54 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.25
2 years, 7 months, 23 days, 14 hours, 26 minutes, 50 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.5.24
2 years, 8 months, 18 days, 21 hours, 48 minutes, 09 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.45
2 years, 0 months, 16 days, 13 hours, 16 minutes, 45 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.44
2 years, 0 months, 16 days, 13 hours, 16 minutes, 41 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.43
2 years, 0 months, 16 days, 13 hours, 16 minutes, 35 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.42
2 years, 0 months, 16 days, 13 hours, 16 minutes, 33 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.41
2 years, 0 months, 16 days, 13 hours, 16 minutes, 30 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.40
2 years, 0 months, 16 days, 13 hours, 16 minutes, 26 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.39
2 years, 0 months, 16 days, 13 hours, 16 minutes, 23 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.38
1 years, 6 months, 8 days, 20 hours, 20 minutes, 22 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.37
1 years, 6 months, 8 days, 20 hours, 20 minutes, 14 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.35 - 5.4.36
1 years, 6 months, 8 days, 20 hours, 20 minutes, 13 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.34
1 years, 6 months, 8 days, 20 hours, 20 minutes, 12 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.4.18 - 5.4.32
1 years, 0 months, 1 days, 16 hours, 59 minutes, 16 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.3.26 - 5.4.17
1 years, 0 months, 1 days, 16 hours, 59 minutes, 17 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.3.5 - 5.3.25
1 years, 0 months, 1 days, 16 hours, 59 minutes, 18 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.4
1 years, 0 months, 1 days, 16 hours, 59 minutes, 19 seconds Catchable fatal error: Object of class DateTime could not be converted to string in /in/F3ih5 on line 7
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/F3ih5 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/F3ih5 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/F3ih5 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/F3ih5 on line 2