3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Y= new DateTime(); $X= new DateTime(null); $S=$X->format('e'); echo($X->format('e') . "\n"); echo($X->format('d/m/Y') . "\n"); $X= new DateTime('@' . $X->format('U')); $X->setTimeZone(new DateTimeZone()); echo($X->format('d/m/Y') . "\n"); echo($X->format('e') . "\n");
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/tSfAo on line 3 Europe/Amsterdam 28/12/2015 Fatal error: Uncaught ArgumentCountError: DateTimeZone::__construct() expects exactly 1 argument, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/tSfAo on line 3 Europe/Amsterdam 28/12/2015 Fatal error: Uncaught ArgumentCountError: DateTimeZone::__construct() expects exactly 1 argument, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
Europe/Amsterdam 28/12/2015 Fatal error: Uncaught ArgumentCountError: DateTimeZone::__construct() expects exactly 1 argument, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 8.0.13
UTC 28/12/2015 Fatal error: Uncaught ArgumentCountError: DateTimeZone::__construct() expects exactly 1 argument, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Europe/Amsterdam 28/12/2015 Fatal error: Uncaught ArgumentCountError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.3.32 - 7.3.33
UTC 28/12/2015 Fatal error: Uncaught ArgumentCountError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.0.20
Europe/Amsterdam 28/12/2015 Fatal error: Uncaught TypeError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.0.6
Europe/Amsterdam 21/05/2016 Fatal error: Uncaught TypeError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.0.5
Europe/Amsterdam 03/04/2016 Fatal error: Uncaught TypeError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.0.4
Europe/Amsterdam 10/03/2016 Fatal error: Uncaught TypeError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.0.3
Europe/Amsterdam 18/03/2016 Fatal error: Uncaught TypeError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.0.2
Europe/Amsterdam 23/03/2016 Fatal error: Uncaught TypeError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.0.1
Europe/Amsterdam 24/03/2016 Fatal error: Uncaught TypeError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 7.0.0
Europe/Amsterdam 27/03/2016 Fatal error: Uncaught TypeError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.28
Europe/Amsterdam 28/12/2015 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.21
Europe/Amsterdam 02/05/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.20
Europe/Amsterdam 10/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.19
Europe/Amsterdam 08/03/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.18
Europe/Amsterdam 15/03/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.17
Europe/Amsterdam 20/03/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.16
Europe/Amsterdam 28/03/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.15
Europe/Amsterdam 29/03/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.14
Europe/Amsterdam 14/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.13
Europe/Amsterdam 15/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.12
Europe/Amsterdam 20/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.11
Europe/Amsterdam 24/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.10
Europe/Amsterdam 25/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.9
Europe/Amsterdam 27/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.6.8
Europe/Amsterdam 30/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.35
Europe/Amsterdam 23/05/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.34
Europe/Amsterdam 11/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.33
Europe/Amsterdam 09/03/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.32
Europe/Amsterdam 17/03/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.31
Europe/Amsterdam 21/03/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.30
Europe/Amsterdam 01/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.29
Europe/Amsterdam 17/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.28
Europe/Amsterdam 21/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.27
Europe/Amsterdam 22/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.26
Europe/Amsterdam 26/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.25
Europe/Amsterdam 29/04/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.
Output for 5.5.24
Europe/Amsterdam 24/05/2016 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/tSfAo:8 Stack trace: #0 /in/tSfAo(8): DateTimeZone->__construct() #1 {main} thrown in /in/tSfAo on line 8
Process exited with code 255.

preferences:
161.77 ms | 401 KiB | 182 Q