3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateTime = new DateTime('now'); echo $dateTime -> format('Y-m-d H:i:s');
Output for 5.2.5, 5.2.13, 5.2.15, 5.3.0, 5.3.2 - 5.3.5, 5.3.10 - 5.3.11, 5.3.13 - 5.3.14, 5.3.17 - 5.3.18, 5.3.20 - 5.3.23, 5.3.27, 5.4.1, 5.4.6, 5.4.8 - 5.4.13, 5.4.15 - 5.4.27, 5.6.28, 7.0.14 - 7.2.6
2014-04-08 10:53:22
Output for 7.0.6
2016-05-03 15:45:06
Output for 7.0.5
2016-04-03 04:20:06
Output for 7.0.4
2016-03-10 15:46:51
Output for 7.0.3
2016-03-18 16:28:43
Output for 7.0.2
2016-03-22 22:34:56
Output for 7.0.1
2016-03-24 02:52:57
Output for 7.0.0
2016-03-27 04:51:17
Output for 5.6.21
2016-05-02 10:56:23
Output for 5.6.20
2016-04-10 03:16:58
Output for 5.6.19
2016-03-07 23:30:35
Output for 5.6.18
2016-03-15 08:24:51
Output for 5.6.17
2016-03-19 20:20:23
Output for 5.6.16
2016-03-28 05:40:21
Output for 5.6.15
2016-03-29 06:32:12
Output for 5.6.14
2016-04-02 08:32:28
Output for 5.6.13
2016-04-15 12:45:37
Output for 5.6.12
2016-04-20 03:08:19
Output for 5.6.11
2016-04-23 09:41:19
Output for 5.6.10
2016-04-25 11:34:54
Output for 5.6.9
2016-04-27 16:41:44
Output for 5.6.8
2016-04-30 01:22:43
Output for 5.5.35
2016-05-22 15:39:32
Output for 5.5.34
2016-04-11 05:31:28
Output for 5.5.33
2016-03-09 02:36:06
Output for 5.5.32
2016-03-17 12:02:50
Output for 5.5.31
2016-03-20 23:05:41
Output for 5.5.30
2016-04-01 08:25:43
Output for 5.5.29
2016-04-17 03:06:32
Output for 5.5.28
2016-04-21 06:18:46
Output for 5.5.27
2016-04-22 08:18:46
Output for 5.5.26
2016-04-26 14:14:29
Output for 5.5.25
2016-04-28 20:52:53
Output for 5.5.24
2016-05-24 16:06:39
Output for 5.4.45
2015-09-17 21:37:07
Output for 5.4.44
2015-08-28 08:47:49
Output for 5.4.43
2015-08-28 08:47:46
Output for 5.4.42
2015-08-28 08:47:45
Output for 5.4.41
2015-08-28 08:47:43
Output for 5.4.40
2015-08-28 08:47:40
Output for 5.4.39
2015-08-28 08:47:39
Output for 5.4.38
2015-02-28 15:36:38
Output for 5.4.36 - 5.4.37
2015-02-05 01:01:14
Output for 5.4.34 - 5.4.35
2014-11-15 14:50:31
Output for 5.4.32
2014-08-30 05:40:46
Output for 5.4.31
2014-08-30 05:40:42
Output for 5.4.30
2014-08-30 05:40:38
Output for 5.4.29
2014-08-30 05:40:37
Output for 5.4.28
2014-08-30 05:40:36
Output for 5.2.0 - 5.2.4, 5.2.6 - 5.2.12, 5.2.14, 5.2.16 - 5.2.17, 5.3.1, 5.3.6 - 5.3.9, 5.3.12, 5.3.15 - 5.3.16, 5.3.19, 5.3.24 - 5.3.26, 5.3.28, 5.4.0, 5.4.2 - 5.4.5, 5.4.7, 5.4.14
2014-04-08 10:53:21
Output for 5.3.29
2014-08-30 05:40:39
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/X91av 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/X91av 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/X91av on line 3