3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $updated_at = new DateTime('2011-06-01'); $today = new DateTime('now'); $interval = $updated_at->diff($today); echo $interval->format('%R%a');
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.24, 5.6.28, 7.0.14 - 7.1.0
+985
Output for 7.0.6
+1798
Output for 7.0.5
+1767
Output for 7.0.4
+1744
Output for 7.0.3
+1752
Output for 7.0.2
+1755
Output for 7.0.1
+1757
Output for 7.0.0
+1760
Output for hhvm-3.12.0
+1745
Output for hhvm-3.10.0
+1764
Output for 5.6.21
+1796
Output for 5.6.20
+1774
Output for 5.6.19
+1741
Output for 5.6.18
+1748
Output for 5.6.17
+1753
Output for 5.6.16
+1761
Output for 5.6.15
+1762
Output for 5.6.14
+1766
Output for 5.6.13
+1780
Output for 5.6.12
+1784
Output for 5.6.11
+1787
Output for 5.6.10
+1790
Output for 5.6.9
+1792
Output for 5.6.8
+1794
Output for 5.6.7
+1820
Output for 5.5.35
+1817
Output for 5.5.34
+1775
Output for 5.5.33
+1742
Output for 5.5.32
+1750
Output for 5.5.31
+1754
Output for 5.5.30
+1765
Output for 5.5.29
+1781
Output for 5.5.28
+1785
Output for 5.5.27
+1786
Output for 5.5.26
+1791
Output for 5.5.25
+1793
Output for 5.5.24
+1818
Output for 5.4.45
+1560
Output for 5.4.41 - 5.4.44
+1536
Output for 5.4.39 - 5.4.40
+1437
Output for 5.4.38
+1370
Output for 5.4.36 - 5.4.37
+1348
Output for 5.4.34 - 5.4.35
+1282
Output for 5.3.29, 5.4.25 - 5.4.32
+1193
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/aMvHm on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/aMvHm 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/aMvHm 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/aMvHm on line 2