3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = new DateTime('now'); $v = new Datetime('now +2 hours'); echo $d->format('Y-m-d H:i:s'); echo $v->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.12 - 7.1.0
2013-09-10 14:11:142013-09-10 16:11:14
Output for 7.0.6
2016-05-21 15:49:352016-05-21 17:49:35
Output for 7.0.5
2016-04-14 13:29:242016-04-14 15:29:24
Output for 7.0.4
2016-03-10 23:43:202016-03-11 01:43:20
Output for 7.0.3
2016-03-19 01:39:002016-03-19 03:39:00
Output for 7.0.2
2016-03-23 07:32:492016-03-23 09:32:49
Output for 7.0.1
2016-03-24 10:31:522016-03-24 12:31:52
Output for 7.0.0
2016-03-27 12:17:172016-03-27 14:17:17
Output for hhvm-3.12.0
2016-03-14 02:27:402016-03-14 04:27:40
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
2016-05-02 18:28:072016-05-02 20:28:07
Output for 5.6.20
2016-04-10 10:35:022016-04-10 12:35:02
Output for 5.6.19
2016-03-08 07:54:472016-03-08 09:54:47
Output for 5.6.18
2016-03-15 17:01:112016-03-15 19:01:11
Output for 5.6.17
2016-03-20 04:39:402016-03-20 06:39:40
Output for 5.6.16
2016-03-28 13:07:222016-03-28 15:07:22
Output for 5.6.15
2016-03-29 13:55:422016-03-29 15:55:42
Output for 5.6.14
2016-04-14 19:39:332016-04-14 21:39:33
Output for 5.6.13
2016-04-15 20:23:122016-04-15 22:23:12
Output for 5.6.12
2016-04-20 11:20:232016-04-20 13:20:23
Output for 5.6.11
2016-04-24 17:19:282016-04-24 19:19:28
Output for 5.6.10
2016-04-25 19:25:272016-04-25 21:25:27
Output for 5.6.9
2016-04-28 01:19:242016-04-28 03:19:24
Output for 5.6.8
2016-04-30 09:16:202016-04-30 11:16:20
Output for 5.5.35
2016-05-23 06:21:472016-05-23 08:21:47
Output for 5.5.34
2016-04-11 12:48:232016-04-11 14:48:23
Output for 5.5.33
2016-03-09 11:04:112016-03-09 13:04:11
Output for 5.5.32
2016-03-17 21:03:102016-03-17 23:03:10
Output for 5.5.31
2016-03-21 07:54:172016-03-21 09:54:17
Output for 5.5.30
2016-04-01 15:46:082016-04-01 17:46:08
Output for 5.5.29
2016-04-17 10:35:292016-04-17 12:35:29
Output for 5.5.28
2016-04-21 14:13:592016-04-21 16:13:59
Output for 5.5.27
2016-04-22 15:47:272016-04-22 17:47:27
Output for 5.5.26
2016-04-26 22:08:462016-04-27 00:08:46
Output for 5.5.25
2016-04-29 05:38:382016-04-29 07:38:38
Output for 5.5.24
2016-05-24 12:25:322016-05-24 14:25:32
Output for 5.4.45
2016-02-19 16:07:072016-02-19 18:07:07
Output for 5.4.42 - 5.4.44
2016-02-19 16:07:082016-02-19 18:07:08
Output for 5.4.41
2016-02-19 16:07:092016-02-19 18:07:09
Output for 5.4.38 - 5.4.40
2016-02-19 16:07:102016-02-19 18:07:10
Output for 5.4.37
2016-02-19 16:07:112016-02-19 18:07:11
Output for 5.4.34 - 5.4.36
2016-02-19 16:07:122016-02-19 18:07:12
Output for 5.3.29, 5.4.31 - 5.4.32
2016-02-19 16:07:132016-02-19 18:07:13
Output for 5.4.28 - 5.4.30
2016-02-19 16:07:142016-02-19 18:07:14
Output for 5.4.25 - 5.4.27
2016-02-19 16:07:152016-02-19 18:07:15
Output for 5.3.28, 5.4.21 - 5.4.24
2016-02-19 16:07:162016-02-19 18:07:16
Output for 5.4.19 - 5.4.20
2016-02-19 16:07:172016-02-19 18:07:17
Output for 5.3.26 - 5.3.27, 5.4.16 - 5.4.18
2016-02-19 16:07:182016-02-19 18:07:18
Output for 5.3.23 - 5.3.25, 5.4.12 - 5.4.15
2016-02-19 16:07:192016-02-19 18:07:19
Output for 5.3.19 - 5.3.22, 5.4.9 - 5.4.11
2016-02-19 16:07:202016-02-19 18:07:20
Output for 5.3.14 - 5.3.18, 5.4.5 - 5.4.8
2016-02-19 16:07:212016-02-19 18:07:21
Output for 5.3.11 - 5.3.13, 5.4.0 - 5.4.4
2016-02-19 16:07:222016-02-19 18:07:22
Output for 5.2.16 - 5.2.17, 5.3.4 - 5.3.10
2016-02-19 16:07:232016-02-19 18:07:23
Output for 5.2.11 - 5.2.15, 5.3.1 - 5.3.3
2016-02-19 16:07:242016-02-19 18:07:24
Output for 5.2.6 - 5.2.10, 5.3.0
2016-02-19 16:07:252016-02-19 18:07:25
Output for 5.2.0 - 5.2.5
2016-02-19 16:07:262016-02-19 18:07:26
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/7WjP0 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/7WjP0 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/7WjP0 on line 2