3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.3.0 - 8.3.6
Deprecated: Function strftime() is deprecated in /in/JdoLv on line 3 09-09-1972<br /> Deprecated: Function strftime() is deprecated in /in/JdoLv on line 6 21-05-2016 Fatal error: Uncaught DateMalformedStringException: Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/JdoLv:8 Stack trace: #0 /in/JdoLv(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/JdoLv on line 8
Process exited with code 255.
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Deprecated: Function strftime() is deprecated in /in/JdoLv on line 3 09-09-1972<br /> Deprecated: Function strftime() is deprecated in /in/JdoLv on line 6 21-05-2016 Fatal error: Uncaught Exception: Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/JdoLv:8 Stack trace: #0 /in/JdoLv(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/JdoLv on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
09-09-1972<br />21-05-2016 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (03-24-2007) at position 0 (0): Unexpected character in /in/JdoLv:8 Stack trace: #0 /in/JdoLv(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/JdoLv on line 8
Process exited with code 255.
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
09-09-1972<br />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/JdoLv:8 Stack trace: #0 /in/JdoLv(8): DateTime->__construct('03-24-2007') #1 {main} thrown in /in/JdoLv on line 8
Process exited with code 255.
Output for 5.1.3 - 5.1.6
09-09-1972<br /> Fatal error: Class 'DateTime' not found in /in/JdoLv on line 5
Process exited with code 255.
Output for 5.1.0 - 5.1.2
21-05-2016<br /> Fatal error: Class 'DateTime' not found in /in/JdoLv on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
18-03-1968<br /> Fatal error: Class 'DateTime' not found in /in/JdoLv on line 5
Process exited with code 255.
Output for 4.3.6 - 4.3.11, 4.4.0 - 4.4.9
18-03-1968<br /> Fatal error: Cannot instantiate non-existent class: datetime in /in/JdoLv 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/JdoLv 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/JdoLv on line 5

preferences:
257.92 ms | 401 KiB | 358 Q