3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = strtotime('last friday of this month'); $d = new DateTime($date); echo $d->format('Y-m-d');
Output for 8.3.0 - 8.3.6
Fatal error: Uncaught DateMalformedStringException: Failed to parse time string (1446159600) at position 7 (6): Unexpected character in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1446159600') #1 {main} thrown in /in/WXrHU on line 5
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 (1446159600) at position 7 (6): Unexpected character in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1446159600') #1 {main} thrown in /in/WXrHU on line 5
Process exited with code 255.
Output for 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 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 (1446159600) at position 7 (6): Unexpected character in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1446159600') #1 {main} thrown in /in/WXrHU on line 5
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 (1446163200) at position 7 (2): Unexpected character in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1446163200') #1 {main} thrown in /in/WXrHU on line 5
Process exited with code 255.
Output for 7.0.6
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1464300000) at position 7 (0): Unexpected character in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1464300000') #1 {main} thrown in /in/WXrHU on line 5
Process exited with code 255.
Output for 7.0.5
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1461880800) at position 8 (0): Unexpected character in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1461880800') #1 {main} thrown in /in/WXrHU on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1458860400) at position 8 (0): Unexpected character in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1458860400') #1 {main} thrown in /in/WXrHU on line 5
Process exited with code 255.
Output for 5.4.2 - 5.4.45, 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1446159600) at position 7 (6): Unexpected character' in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1446159600') #1 {main} thrown in /in/WXrHU on line 5
Process exited with code 255.
Output for 5.5.24, 5.5.35, 5.6.7, 5.6.21
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1464300000) at position 7 (0): Unexpected character' in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1464300000') #1 {main} thrown in /in/WXrHU on line 5
Process exited with code 255.
Output for 5.5.25 - 5.5.29, 5.5.34, 5.6.8 - 5.6.14, 5.6.20
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461880800) at position 8 (0): Unexpected character' in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1461880800') #1 {main} thrown in /in/WXrHU on line 5
Process exited with code 255.
Output for 5.5.30 - 5.5.33, 5.6.15 - 5.6.19
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1458860400) at position 8 (0): Unexpected character' in /in/WXrHU:5 Stack trace: #0 /in/WXrHU(5): DateTime->__construct('1458860400') #1 {main} thrown in /in/WXrHU on line 5
Process exited with code 255.

preferences:
175.65 ms | 402 KiB | 227 Q