3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datetime1 = new DateTime; $datetime2 = new DateTime('2014-09-13 18:23:09.73 CDT'); $interval = $datetime1->diff($datetime2); echo $interval->format('%R %D %M %Y');
based on r0dPP
Output for 5.3.0 - 5.4.32, 5.6.28, 7.0.14 - 7.1.0
- 00 00 00
Output for 7.0.6
- 19 07 01
Output for 7.0.5
- 18 06 01
Output for 7.0.4
- 26 05 01
Output for 7.0.3
- 04 06 01
Output for 7.0.2
- 08 06 01
Output for 7.0.1
- 09 06 01
Output for 7.0.0
- 12 06 01
Output for hhvm-3.12.0
- 27 05 01
Output for hhvm-3.10.0
- 16 06 01
Output for 5.6.21
- 18 07 01
Output for 5.6.20
- 25 06 01
Output for 5.6.19
- 23 05 01
Output for 5.6.18
- 00 06 01
Output for 5.6.17
- 05 06 01
Output for 5.6.16
- 13 06 01
Output for 5.6.15
- 14 06 01
Output for 5.5.30, 5.6.14
- 17 06 01
Output for 5.6.13
- 01 07 01
Output for 5.6.12
- 05 07 01
Output for 5.6.11
- 08 07 01
Output for 5.6.10
- 11 07 01
Output for 5.6.9
- 13 07 01
Output for 5.6.8
- 15 07 01
Output for 5.6.7
- 11 08 01
Output for 5.5.35
- 08 08 01
Output for 5.5.34
- 26 06 01
Output for 5.5.33
- 24 05 01
Output for 5.5.32
- 02 06 01
Output for 5.5.31
- 06 06 01
Output for 5.5.29
- 02 07 01
Output for 5.5.28
- 06 07 01
Output for 5.5.27
- 07 07 01
Output for 5.5.26
- 12 07 01
Output for 5.5.25
- 14 07 01
Output for 5.5.24
- 09 08 01
Output for 5.4.39 - 5.4.45
- 07 00 01
Output for 5.4.34 - 5.4.38
- 00 06 00
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/cVSlP on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/cVSlP on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/cVSlP on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/cVSlP on line 3