3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sunday_day = new DateTime(strtotime('last sunday')); echo(date_format($sunday_day, 'm/d/Y'));
based on CC0cR
Output for 5.2.0 - 5.3.28, 5.4.0 - 5.4.31, 5.6.28, 7.0.14 - 7.1.0
08/01/2000
Output for 7.0.6
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1462053600) at position 7 (6): Unexpected character in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1462053600') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 7.0.5
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1459033200) at position 7 (2): Unexpected character in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1459033200') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 7.0.4
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1457218800) at position 7 (8): Unexpected character in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1457218800') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 7.0.3
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1457823600) at position 8 (0): Unexpected character in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1457823600') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 7.0.2
03/22/8400
Output for 7.0.1
03/23/8400
Output for 7.0.0
03/26/8400
Output for hhvm-3.12.0
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1457218800) at position 7 (8): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1459033200) at position 7 (2): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.21
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1462053600) at position 7 (6): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1462053600') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.6.20
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1459634400) at position 8 (0): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1459634400') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.5.33, 5.6.19
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1457218800) at position 7 (8): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1457218800') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.5.31 - 5.5.32, 5.6.17 - 5.6.18
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1457823600) at position 8 (0): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1457823600') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.6.16
03/27/8400
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 (1459033200) at position 7 (2): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1459033200') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.5.29, 5.5.34, 5.6.13
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1460239200) at position 7 (2): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1460239200') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.5.27 - 5.5.28, 5.6.11 - 5.6.12
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1460844000) at position 8 (0): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1460844000') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.5.25 - 5.5.26, 5.6.8 - 5.6.10
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461448800) at position 8 (0): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1461448800') #1 {main} thrown in /in/JEg4d 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 (1463263200) at position 7 (2): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1463263200') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.5.24
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1463868000) at position 8 (0): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1463868000') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.4.39 - 5.4.45
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1442700000) at position 8 (0): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1442700000') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.4.34 - 5.4.38
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1425769200) at position 8 (0): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1425769200') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.3.29, 5.4.32
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1408831200) at position 8 (0): Unexpected character' in /in/JEg4d:3 Stack trace: #0 /in/JEg4d(3): DateTime->__construct('1408831200') #1 {main} thrown in /in/JEg4d on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/JEg4d on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/JEg4d 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/JEg4d on line 3