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("03-24-2007"); $date2 = new DateTime("03-26-2009"); $interval = $date1->diff($date2); echo "difference " . $interval->y . " years, " . $interval->m." months, ".$interval->d." days ";
Output for 7.0.14 - 7.1.0
04-01-1970<br />15-09-2013 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 7.0.6
22-08-1972<br />03-05-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 7.0.5
22-07-1972<br />02-04-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 7.0.4
29-06-1972<br />10-03-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 7.0.3
07-07-1972<br />18-03-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 7.0.2
11-07-1972<br />22-03-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 7.0.1
12-07-1972<br />23-03-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 7.0.0
15-07-1972<br />26-03-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.28
04-01-1970<br />15-09-2013 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.21
21-08-1972<br />02-05-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.20
29-07-1972<br />09-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.19
26-06-1972<br />07-03-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.18
03-07-1972<br />14-03-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.17
08-07-1972<br />19-03-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.16
16-07-1972<br />27-03-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.15
17-07-1972<br />28-03-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.14
22-07-1972<br />02-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.13
04-08-1972<br />15-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.12
08-08-1972<br />19-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.11
12-08-1972<br />23-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.10
14-08-1972<br />25-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.9
16-08-1972<br />27-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.8
18-08-1972<br />29-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.6.7
13-09-1972<br />25-05-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.35
10-09-1972<br />22-05-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.34
30-07-1972<br />10-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.33
27-06-1972<br />08-03-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.32
06-07-1972<br />17-03-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.31
09-07-1972<br />20-03-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.30
21-07-1972<br />01-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.29
05-08-1972<br />16-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.28
09-08-1972<br />20-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.27
11-08-1972<br />22-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.26
15-08-1972<br />26-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.25
17-08-1972<br />28-04-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.5.24
11-09-1972<br />23-05-2016 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.4.45
03-01-1972<br />14-09-2015 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.4.39 - 5.4.44
29-11-1971<br />10-08-2015 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.4.34 - 5.4.38
22-06-1971<br />03-03-2015 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.3.28 - 5.3.29, 5.4.20 - 5.4.32
01-01-1971<br />12-09-2014 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/sU1C9:8 Stack trace: #0 /in/sU1C9(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/sU1C9 on line 8
Process exited with code 255.
Output for 5.2.0 - 5.3.27, 5.4.0 - 5.4.19
04-01-1970<br />15-09-2013 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character' in /in/L1QRt:8 Stack trace: #0 /in/L1QRt(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/L1QRt on line 8
Process exited with code 255.
Output for 5.1.3 - 5.1.6
04-01-1970<br />15-09-2013 Fatal error: Class 'DateTime' not found in /in/L1QRt on line 8
Process exited with code 255.
Output for 5.1.0 - 5.1.2
15-09-2013<br />15-09-2013 Fatal error: Class 'DateTime' not found in /in/L1QRt on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5
13-07-1965<br />15-09-2013 Fatal error: Class 'DateTime' not found in /in/L1QRt on line 8
Process exited with code 255.
Output for 4.3.6 - 4.4.9
13-07-1965<br />15-09-2013 Fatal error: Cannot instantiate non-existent class: datetime in /in/L1QRt on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.5
<br />15-09-2013 Fatal error: Cannot instantiate non-existent class: datetime in /in/L1QRt on line 8
Process exited with code 255.
Output for 4.3.1
<br />15-09-2013 Fatal error: Cannot instantiate non-existent class: datetime in /in/L1QRt on line 8
Output for 4.3.0
<br />14-09-2015 Fatal error: Cannot instantiate non-existent class: datetime in /in/sU1C9 on line 8