3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start = new DateTime('2010-10-12'); $end = new DateTime(); echo round(($end->format('U') - $start->format('U')) / (60*60*24));
Output for 5.6.28, 7.0.14 - 7.1.0
1347
Output for 7.0.6
2031
Output for 7.0.5
2000
Output for 7.0.4
1977
Output for 7.0.3
1985
Output for 7.0.2
1989
Output for 7.0.1
1990
Output for 7.0.0
1993
Output for hhvm-3.12.0
1979
Output for hhvm-3.10.0
1997
Output for 5.6.21
2029
Output for 5.6.20
2007
Output for 5.6.19
1974
Output for 5.6.18
1981
Output for 5.6.17
1986
Output for 5.6.16
1994
Output for 5.6.15
1995
Output for 5.6.14
1999
Output for 5.6.13
2012
Output for 5.6.12
2017
Output for 5.6.11
2020
Output for 5.6.10
2022
Output for 5.6.9
2025
Output for 5.6.8
2027
Output for 5.5.35
2049
Output for 5.5.34
2008
Output for 5.5.33
1975
Output for 5.5.32
1983
Output for 5.5.31
1987
Output for 5.5.30
1998
Output for 5.5.29
2014
Output for 5.5.28
2018
Output for 5.5.27
2019
Output for 5.5.26
2023
Output for 5.5.25
2026
Output for 5.5.24
2051
Output for 5.2.0 - 5.4.45
1828
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/71uWH 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/71uWH 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/71uWH on line 3