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%a days');
based on tC2rT
Output for 5.3.0 - 5.4.32, 5.6.28, 7.0.14 - 7.1.0
-0 days
Output for 7.0.6
-597 days
Output for 5.6.14, 7.0.5
-566 days
Output for 7.0.4
-543 days
Output for 7.0.3
-551 days
Output for 7.0.2
-555 days
Output for 7.0.1
-556 days
Output for 7.0.0
-559 days
Output for hhvm-3.12.0
-545 days
Output for hhvm-3.10.0
-563 days
Output for 5.6.21
-596 days
Output for 5.6.20
-573 days
Output for 5.6.19
-540 days
Output for 5.6.18
-548 days
Output for 5.6.17
-552 days
Output for 5.6.16
-560 days
Output for 5.6.15
-561 days
Output for 5.6.13
-579 days
Output for 5.6.12
-583 days
Output for 5.6.11
-587 days
Output for 5.6.10
-589 days
Output for 5.6.9
-591 days
Output for 5.6.8
-593 days
Output for 5.5.35
-616 days
Output for 5.5.34
-574 days
Output for 5.5.33
-541 days
Output for 5.5.32
-550 days
Output for 5.5.31
-553 days
Output for 5.5.30
-565 days
Output for 5.5.29
-580 days
Output for 5.5.28
-584 days
Output for 5.5.27
-586 days
Output for 5.5.26
-590 days
Output for 5.5.25
-592 days
Output for 5.5.24
-617 days
Output for 5.4.39 - 5.4.45
-372 days
Output for 5.4.34 - 5.4.38
-181 days
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/Vb0hc on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Vb0hc 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/Vb0hc 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/Vb0hc on line 3