3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('now'); $date->modify('null'); echo $date->format('h:m:s d-m-Y');
Output for 7.0.12 - 7.1.0
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 09:08:00 14-08-2013
Output for 7.0.6
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 09:05:27 03-05-2016
Output for 5.5.34, 5.6.20, 7.0.5
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:45 11-04-2016
Output for 5.5.32 - 5.5.33, 5.6.18 - 5.6.19, hhvm-3.12.0, 7.0.4
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:46 11-04-2016
Output for 5.5.31, 5.6.17, 7.0.0 - 7.0.3
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:47 11-04-2016
Output for hhvm-3.10.0
08:04:48 11-04-2016
Output for 5.6.21
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 05:05:28 02-05-2016
Output for 5.5.30, 5.6.13 - 5.6.16
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:48 11-04-2016
Output for 5.5.28 - 5.5.29, 5.6.12
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:49 11-04-2016
Output for 5.5.26 - 5.5.27, 5.6.10 - 5.6.11
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:50 11-04-2016
Output for 5.5.25, 5.6.8 - 5.6.9
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:51 11-04-2016
Output for 5.5.22 - 5.5.24, 5.6.6 - 5.6.7
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:52 11-04-2016
Output for 5.5.20 - 5.5.21, 5.6.4 - 5.6.5
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:53 11-04-2016
Output for 5.5.18 - 5.5.19, 5.6.1 - 5.6.3
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:54 11-04-2016
Output for 5.5.14 - 5.5.16, 5.6.0
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:55 11-04-2016
Output for 5.5.35
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 09:05:00 22-05-2016
Output for 5.5.11 - 5.5.13
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:56 11-04-2016
Output for 5.5.8 - 5.5.10
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:57 11-04-2016
Output for 5.5.5 - 5.5.7
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:58 11-04-2016
Output for 5.5.2 - 5.5.4
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:59 11-04-2016
Output for 5.5.0 - 5.5.1
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:00 11-04-2016
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/sNCu4:2 Stack trace: #0 /in/sNCu4(2): DateTime->__construct('now') #1 {main} thrown in /in/sNCu4 on line 2
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/sNCu4:2 Stack trace: #0 /in/sNCu4(2): DateTime->__construct('now') #1 {main} thrown in /in/sNCu4 on line 2
Process exited with code 255.
Output for 5.2.17
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:05 11-04-2016
Output for 5.2.13 - 5.2.16
Warning: DateTime::modify(): Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database in /in/sNCu4 on line 3 08:04:06 11-04-2016
Output for 5.2.12
08:04:06 11-04-2016
Output for 5.2.6 - 5.2.11
08:04:07 11-04-2016
Output for 5.2.0 - 5.2.5
08:04:08 11-04-2016
Output for 5.0.0 - 5.1.6
<br /> <b>Fatal error</b>: Class 'DateTime' not found in <b>/in/sNCu4</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: datetime in <b>/in/sNCu4</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: datetime in <b>/in/sNCu4</b> on line <b>2</b><br />