3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time = new DateTime('now'); var_dump($time->format(DateTime::ISO8601));
Output for 5.6.28, 7.0.12 - 7.1.0
string(24) "2013-10-16T21:56:24+0200"
Output for 7.0.6
string(24) "2016-05-03T01:08:21+0200"
Output for 5.5.34, 5.6.19 - 5.6.20, 7.0.5
string(24) "2016-04-13T00:04:15+0200"
Output for 5.5.32 - 5.5.33, 5.6.18, hhvm-3.12.0, 7.0.4
string(24) "2016-04-13T00:04:16+0200"
Output for 5.5.31, 5.6.17, 7.0.1 - 7.0.3
string(24) "2016-04-13T00:04:17+0200"
Output for 5.6.14 - 5.6.16, hhvm-3.10.0, 7.0.0
string(24) "2016-04-13T00:04:18+0200"
Output for 5.6.21
string(24) "2016-05-01T20:13:05+0200"
Output for 5.5.29 - 5.5.30, 5.6.13
string(24) "2016-04-13T00:04:19+0200"
Output for 5.5.27 - 5.5.28, 5.6.11 - 5.6.12
string(24) "2016-04-13T00:04:20+0200"
Output for 5.5.26, 5.6.9 - 5.6.10
string(24) "2016-04-13T00:04:21+0200"
Output for 5.5.24 - 5.5.25, 5.6.7 - 5.6.8
string(24) "2016-04-13T00:04:22+0200"
Output for 5.5.21 - 5.5.23, 5.6.6
string(24) "2016-04-13T00:04:23+0200"
Output for 5.5.20, 5.6.4 - 5.6.5
string(24) "2016-04-13T00:04:24+0200"
Output for 5.5.18 - 5.5.19, 5.6.1 - 5.6.3
string(24) "2016-04-13T00:04:25+0200"
Output for 5.5.15 - 5.5.16, 5.6.0
string(24) "2016-04-13T00:04:26+0200"
Output for 5.5.35
string(24) "2016-05-21T23:18:19+0200"
Output for 5.5.12 - 5.5.14
string(24) "2016-04-13T00:04:27+0200"
Output for 5.5.9 - 5.5.11
string(24) "2016-04-13T00:04:28+0200"
Output for 5.5.6 - 5.5.8
string(24) "2016-04-13T00:04:29+0200"
Output for 5.5.3 - 5.5.5
string(24) "2016-04-13T00:04:30+0200"
Output for 5.5.0 - 5.5.2
string(24) "2016-04-13T00:04:31+0200"
Output for 5.4.0 - 5.4.45
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /in/2rtFM:3 Stack trace: #0 /in/2rtFM(3): DateTime->__construct('now') #1 {main} thrown in /in/2rtFM on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead' in /in/2rtFM:3 Stack trace: #0 /in/2rtFM(3): DateTime->__construct('now') #1 {main} thrown in /in/2rtFM on line 3
Process exited with code 255.
Output for 5.2.16 - 5.2.17
string(24) "2016-04-13T00:04:37+0200"
Output for 5.2.12 - 5.2.15
string(24) "2016-04-13T00:04:38+0200"
Output for 5.2.7 - 5.2.11
string(24) "2016-04-13T00:04:39+0200"
Output for 5.2.2 - 5.2.6
string(24) "2016-04-13T00:04:40+0200"
Output for 5.2.0 - 5.2.1
string(24) "2016-04-13T00:04:41+0200"
Output for 5.0.0 - 5.1.6
<br /> <b>Fatal error</b>: Class 'DateTime' not found in <b>/in/2rtFM</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected ')', expecting '(' in <b>/in/2rtFM</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected ')', expecting '(' in <b>/in/2rtFM</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `'('' in <b>/in/2rtFM</b> on line <b>4</b><br />
Process exited with code 255.