3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime(strtotime('next Tuesday')); echo $date->format('YY-mm-dd');
Output for 8.3.0 - 8.3.6
Fatal error: Uncaught DateMalformedStringException: Failed to parse time string (1441663200) at position 8 (0): Unexpected character in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1441663200') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Fatal error: Uncaught Exception: Failed to parse time string (1441663200) at position 8 (0): Unexpected character in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1441663200') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1441663200) at position 8 (0): Unexpected character in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1441663200') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 8.0.13
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1441670400) at position 8 (0): Unexpected character in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1441670400') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 7.0.6
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1462831200) at position 8 (0): Unexpected character in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1462831200') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 7.0.5
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1459807200) at position 8 (0): Unexpected character in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1459807200') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 7.0.4
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1457996400) at position 8 (0): Unexpected character in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1457996400') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 7.0.3
12001200-0303-1818
Output for 7.0.0 - 7.0.2
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1459202400) at position 7 (4): Unexpected character in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1459202400') #1 {main} thrown in /in/HX0fb on line 3
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.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1441663200) at position 8 (0): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1441663200') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.5.25 - 5.5.26, 5.6.8 - 5.6.9, 5.6.21
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1462226400) at position 7 (4): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1462226400') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.5.34, 5.6.20
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1460412000) at position 8 (0): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1460412000') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.6.19
16001600-0303-0707
Output for 5.6.18
12001200-0303-1515
Output for 5.6.17
12001200-0303-1919
Output for 5.6.16
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1459202400) at position 7 (4): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1459202400') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.5.30, 5.6.14 - 5.6.15
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1459807200) at position 8 (0): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1459807200') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.5.29, 5.6.13
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461016800) at position 7 (8): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1461016800') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.5.27 - 5.5.28, 5.6.10 - 5.6.12
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461621600) at position 8 (0): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1461621600') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.5.35
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1464040800) at position 8 (0): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1464040800') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.5.33
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1457996400) at position 8 (0): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1457996400') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.5.32
12001200-0303-1717
Output for 5.5.31
12001200-0303-2020
Output for 5.5.24
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1464645600) at position 8 (0): Unexpected character' in /in/HX0fb:3 Stack trace: #0 /in/HX0fb(3): DateTime->__construct('1464645600') #1 {main} thrown in /in/HX0fb on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/HX0fb on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/HX0fb 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/HX0fb on line 3

preferences:
218.35 ms | 401 KiB | 341 Q