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 />'; $now = new DateTime($now); 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.12 - 7.1.0
04-01-1970<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 7.0.6
22-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 7.0.5
22-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 7.0.4
28-06-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 09-03-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 7.0.3
06-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 17-03-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 7.0.2
10-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 21-03-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 7.0.1
12-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 7.0.0
15-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for hhvm-3.12.0
30-06-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 11-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
18-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 29-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.28
04-01-1970<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.21
20-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 01-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.20
29-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.19
25-06-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 06-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.18
03-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.17
08-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.16
16-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.15
17-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.14
21-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.13
03-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 14-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.12
08-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.11
11-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.10
13-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 24-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.9
16-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.8
18-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.6.7
12-09-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 24-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.35
09-09-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 21-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.34
30-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.33
27-06-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.32
04-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 15-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.31
09-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.30
20-07-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 31-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.29
05-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.28
09-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.27
10-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 21-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.26
14-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.25
17-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.5.24
19-08-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 30-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.2.0 - 5.4.45
10-06-1972<br /> Notice: Undefined variable: now in /in/d0ouZ on line 5 20-02-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/d0ouZ:8 Stack trace: #0 /in/d0ouZ(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/d0ouZ on line 8
Process exited with code 255.
Output for 5.1.3 - 5.1.6
10-06-1972<br /> Fatal error: Class 'DateTime' not found in /in/d0ouZ on line 5
Process exited with code 255.
Output for 5.1.0 - 5.1.2
20-02-2016<br /> Fatal error: Class 'DateTime' not found in /in/d0ouZ on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
18-12-1967<br /> Fatal error: Class 'DateTime' not found in /in/d0ouZ on line 5
Process exited with code 255.
Output for 4.3.6 - 4.4.9
18-12-1967<br /> Fatal error: Cannot instantiate non-existent class: datetime in /in/d0ouZ on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.5
<br /> Fatal error: Cannot instantiate non-existent class: datetime in /in/d0ouZ on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> Fatal error: Cannot instantiate non-existent class: datetime in /in/d0ouZ on line 5