3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $calcul = (strtotime("today") - strtotime("12-09-2013")); echo strftime("%d-%m-%Y", $calcul) . '<br />'; echo strftime("%d-%m-%Y", strtotime("today")); $date1 = new DateTime("24-03-2007"); $date2 = new DateTime("26-03-2009"); $interval = $date1->diff($date2); echo "difference " . $interval->y . " years, " . $interval->m." months, ".$interval->d." days ";
Output for 5.6.28, 7.0.14 - 7.1.0
04-01-1970<br />15-09-2013difference 2 years, 0 months, 2 days
Output for 7.0.6
22-08-1972<br />03-05-2016difference 2 years, 0 months, 2 days
Output for 7.0.5
22-07-1972<br />02-04-2016difference 2 years, 0 months, 2 days
Output for 7.0.4
28-06-1972<br />09-03-2016difference 2 years, 0 months, 2 days
Output for 7.0.3
06-07-1972<br />17-03-2016difference 2 years, 0 months, 2 days
Output for 7.0.2
10-07-1972<br />21-03-2016difference 2 years, 0 months, 2 days
Output for 7.0.1
12-07-1972<br />23-03-2016difference 2 years, 0 months, 2 days
Output for 7.0.0
15-07-1972<br />26-03-2016difference 2 years, 0 months, 2 days
Output for hhvm-3.12.0
30-06-1972<br />11-03-2016difference 2 years, 0 months, 2 days
Output for hhvm-3.10.0
18-07-1972<br />29-03-2016difference 2 years, 0 months, 2 days
Output for 5.6.21
20-08-1972<br />01-05-2016difference 2 years, 0 months, 2 days
Output for 5.6.20
29-07-1972<br />09-04-2016difference 2 years, 0 months, 2 days
Output for 5.6.19
25-06-1972<br />06-03-2016difference 2 years, 0 months, 2 days
Output for 5.6.18
03-07-1972<br />14-03-2016difference 2 years, 0 months, 2 days
Output for 5.6.17
08-07-1972<br />19-03-2016difference 2 years, 0 months, 2 days
Output for 5.6.16
16-07-1972<br />27-03-2016difference 2 years, 0 months, 2 days
Output for 5.6.15
17-07-1972<br />28-03-2016difference 2 years, 0 months, 2 days
Output for 5.6.14
21-07-1972<br />01-04-2016difference 2 years, 0 months, 2 days
Output for 5.6.13
03-08-1972<br />14-04-2016difference 2 years, 0 months, 2 days
Output for 5.6.12
08-08-1972<br />19-04-2016difference 2 years, 0 months, 2 days
Output for 5.6.11
11-08-1972<br />22-04-2016difference 2 years, 0 months, 2 days
Output for 5.6.10
13-08-1972<br />24-04-2016difference 2 years, 0 months, 2 days
Output for 5.6.9
16-08-1972<br />27-04-2016difference 2 years, 0 months, 2 days
Output for 5.6.8
18-08-1972<br />29-04-2016difference 2 years, 0 months, 2 days
Output for 5.6.7
12-09-1972<br />24-05-2016difference 2 years, 0 months, 2 days
Output for 5.5.35
09-09-1972<br />21-05-2016difference 2 years, 0 months, 2 days
Output for 5.5.34
30-07-1972<br />10-04-2016difference 2 years, 0 months, 2 days
Output for 5.5.33
27-06-1972<br />08-03-2016difference 2 years, 0 months, 2 days
Output for 5.5.32
04-07-1972<br />15-03-2016difference 2 years, 0 months, 2 days
Output for 5.5.31
09-07-1972<br />20-03-2016difference 2 years, 0 months, 2 days
Output for 5.5.30
20-07-1972<br />31-03-2016difference 2 years, 0 months, 2 days
Output for 5.5.29
05-08-1972<br />16-04-2016difference 2 years, 0 months, 2 days
Output for 5.5.28
09-08-1972<br />20-04-2016difference 2 years, 0 months, 2 days
Output for 5.5.27
10-08-1972<br />21-04-2016difference 2 years, 0 months, 2 days
Output for 5.5.26
14-08-1972<br />25-04-2016difference 2 years, 0 months, 2 days
Output for 5.5.25
17-08-1972<br />28-04-2016difference 2 years, 0 months, 2 days
Output for 5.5.24
19-08-1972<br />30-04-2016difference 2 years, 0 months, 2 days
Output for 5.3.0 - 5.4.45
09-03-1972<br />19-11-2015difference 2 years, 0 months, 2 days
Output for 5.2.0 - 5.2.17
09-03-1972<br />19-11-2015 Fatal error: Call to undefined method DateTime::diff() in /in/D6PUd on line 10
Process exited with code 255.
Output for 5.1.3 - 5.1.6
09-03-1972<br />19-11-2015 Fatal error: Class 'DateTime' not found in /in/D6PUd on line 8
Process exited with code 255.
Output for 5.1.0 - 5.1.2
19-11-2015<br />19-11-2015 Fatal error: Class 'DateTime' not found in /in/D6PUd on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5
16-09-1967<br />19-11-2015 Fatal error: Class 'DateTime' not found in /in/D6PUd on line 8
Process exited with code 255.
Output for 4.3.6 - 4.4.9
16-09-1967<br />19-11-2015 Fatal error: Cannot instantiate non-existent class: datetime in /in/D6PUd on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.5
<br />19-11-2015 Fatal error: Cannot instantiate non-existent class: datetime in /in/D6PUd on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br />19-11-2015 Fatal error: Cannot instantiate non-existent class: datetime in /in/D6PUd on line 8