3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date1 = new DateTime("2011-07-06"); $date2 = new DateTime(); $diff = $date2->diff($date1)->format("%a"); echo $diff;
based on daOr9
Output for 5.3.19 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
1576
Output for 7.0.6
1763
Output for 7.0.5
1733
Output for 7.0.4
1709
Output for 7.0.3
1717
Output for 7.0.2
1722
Output for 7.0.1
1723
Output for 7.0.0
1726
Output for 5.6.21
1762
Output for 5.6.20
1740
Output for 5.6.19
1707
Output for 5.6.18
1714
Output for 5.6.17
1718
Output for 5.6.16
1727
Output for 5.6.15
1728
Output for 5.6.14
1732
Output for 5.6.13
1745
Output for 5.6.12
1750
Output for 5.6.11
1754
Output for 5.6.10
1755
Output for 5.6.9
1757
Output for 5.6.8
1760
Output for 5.5.35
1782
Output for 5.5.34
1741
Output for 5.5.33
1708
Output for 5.5.32
1716
Output for 5.5.31
1720
Output for 5.5.30
1731
Output for 5.5.29
1747
Output for 5.5.28
1751
Output for 5.5.27
1752
Output for 5.5.26
1756
Output for 5.5.25
1758
Output for 5.5.24
1784