3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $runDateTime = new DateTime(); $updatedTime = $runDateTime; $updatedTime->add(new DateInterval('PT2M')); echo $runDateTime ->format('Y-m-d H:i:s'); echo $updatedTime ->format('Y-m-d H:i:s'); if ($updatedTime > $runDateTime) { echo 3; }
based on NDD86
Output for 5.6.28, 7.0.14 - 7.1.0
2014-10-16 16:53:362014-10-16 16:53:36
Output for 7.0.6
2016-05-03 19:20:442016-05-03 19:20:44
Output for 7.0.5
2016-04-03 07:43:042016-04-03 07:43:04
Output for 7.0.4
2016-03-10 19:33:512016-03-10 19:33:51
Output for 7.0.3
2016-03-18 20:49:582016-03-18 20:49:58
Output for 7.0.2
2016-03-23 02:58:362016-03-23 02:58:36
Output for 7.0.1
2016-03-24 06:27:192016-03-24 06:27:19
Output for 7.0.0
2016-03-27 08:22:512016-03-27 08:22:51
Output for hhvm-3.12.0
2016-03-13 11:43:392016-03-13 11:43:39
Output for hhvm-3.10.0
2016-03-31 03:36:072016-03-31 03:36:07
Output for 5.6.21
2016-05-02 14:29:322016-05-02 14:29:32
Output for 5.6.20
2016-04-10 06:43:172016-04-10 06:43:17
Output for 5.6.19
2016-03-08 03:46:022016-03-08 03:46:02
Output for 5.6.18
2016-03-15 12:35:112016-03-15 12:35:11
Output for 5.6.17
2016-03-20 00:10:072016-03-20 00:10:07
Output for 5.6.16
2016-03-28 09:11:232016-03-28 09:11:23
Output for 5.6.15
2016-03-29 10:01:082016-03-29 10:01:08
Output for 5.6.14
2016-04-02 11:50:092016-04-02 11:50:09
Output for 5.6.13
2016-04-15 16:20:232016-04-15 16:20:23
Output for 5.6.12
2016-04-20 06:48:082016-04-20 06:48:08
Output for 5.6.11
2016-04-24 13:11:562016-04-24 13:11:56
Output for 5.6.10
2016-04-25 15:14:522016-04-25 15:14:52
Output for 5.6.9
2016-04-27 20:24:082016-04-27 20:24:08
Output for 5.6.8
2016-04-30 05:15:392016-04-30 05:15:39
Output for 5.5.35
2016-05-22 22:38:362016-05-22 22:38:36
Output for 5.5.34
2016-04-11 08:54:252016-04-11 08:54:25
Output for 5.5.33
2016-03-09 06:34:472016-03-09 06:34:47
Output for 5.5.32
2016-03-17 16:25:212016-03-17 16:25:21
Output for 5.5.31
2016-03-21 03:14:252016-03-21 03:14:25
Output for 5.5.30
2016-04-01 11:54:122016-04-01 11:54:12
Output for 5.5.29
2016-04-17 06:40:222016-04-17 06:40:22
Output for 5.5.28
2016-04-21 10:03:072016-04-21 10:03:07
Output for 5.5.27
2016-04-22 11:47:012016-04-22 11:47:01
Output for 5.5.26
2016-04-26 17:56:452016-04-26 17:56:45
Output for 5.5.25
2016-04-29 01:17:452016-04-29 01:17:45
Output for 5.5.24
2016-05-24 07:33:322016-05-24 07:33:32
Output for 5.4.45
2015-11-25 16:08:382015-11-25 16:08:38
Output for 5.4.44
2015-11-25 16:08:412015-11-25 16:08:41
Output for 5.4.43
2015-11-25 16:08:442015-11-25 16:08:44
Output for 5.4.42
2015-11-25 16:08:462015-11-25 16:08:46
Output for 5.4.41
2015-11-25 16:08:472015-11-25 16:08:47
Output for 5.4.40
2015-11-25 16:08:502015-11-25 16:08:50
Output for 5.4.39
2015-11-25 16:08:532015-11-25 16:08:53
Output for 5.4.38
2015-11-25 16:08:542015-11-25 16:08:54
Output for 5.4.37
2015-11-25 16:08:562015-11-25 16:08:56
Output for 5.4.36
2015-11-25 16:08:572015-11-25 16:08:57
Output for 5.4.35
2015-11-25 16:08:582015-11-25 16:08:58
Output for 5.4.34
2015-11-25 16:09:002015-11-25 16:09:00
Output for 5.3.29, 5.4.32
2015-11-25 16:09:032015-11-25 16:09:03
Output for 5.4.31
2015-11-25 16:09:042015-11-25 16:09:04
Output for 5.4.30
2015-11-25 16:09:052015-11-25 16:09:05
Output for 5.4.28 - 5.4.29
2015-11-25 16:09:062015-11-25 16:09:06
Output for 5.4.27
2015-11-25 16:09:072015-11-25 16:09:07
Output for 5.4.26
2015-11-25 16:09:082015-11-25 16:09:08
Output for 5.4.25
2015-11-25 16:09:092015-11-25 16:09:09
Output for 5.4.23 - 5.4.24
2015-11-25 16:09:112015-11-25 16:09:11
Output for 5.4.22
2015-11-25 16:09:132015-11-25 16:09:13
Output for 5.4.21
2015-11-25 16:09:142015-11-25 16:09:14
Output for 5.4.20
2015-11-25 16:09:152015-11-25 16:09:15
Output for 5.4.19
2015-11-25 16:09:162015-11-25 16:09:16
Output for 5.4.18
2015-11-25 16:09:172015-11-25 16:09:17
Output for 5.4.17
2015-11-25 16:09:192015-11-25 16:09:19
Output for 5.3.26, 5.4.16
2015-11-25 16:09:202015-11-25 16:09:20
Output for 5.4.15
2015-11-25 16:09:212015-11-25 16:09:21
Output for 5.3.24 - 5.3.25, 5.4.14
2015-11-25 16:09:222015-11-25 16:09:22
Output for 5.3.23, 5.4.13
2015-11-25 16:09:232015-11-25 16:09:23
Output for 5.3.22, 5.4.12
2015-11-25 16:09:242015-11-25 16:09:24
Output for 5.3.21, 5.4.11
2015-11-25 16:09:252015-11-25 16:09:25
Output for 5.4.9 - 5.4.10
2015-11-25 16:09:272015-11-25 16:09:27
Output for 5.3.17, 5.4.8
2015-11-25 16:09:292015-11-25 16:09:29
Output for 5.4.6 - 5.4.7
2015-11-25 16:09:302015-11-25 16:09:30
Output for 5.3.14, 5.4.5
2015-11-25 16:09:322015-11-25 16:09:32
Output for 5.4.3 - 5.4.4
2015-11-25 16:09:332015-11-25 16:09:33
Output for 5.3.11, 5.4.2
2015-11-25 16:09:352015-11-25 16:09:35
Output for 5.4.0 - 5.4.1
2015-11-25 16:09:362015-11-25 16:09:36
Output for 5.3.28
2015-11-25 16:09:122015-11-25 16:09:12
Output for 5.3.27
2015-11-25 16:09:182015-11-25 16:09:18
Output for 5.3.20
2015-11-25 16:09:262015-11-25 16:09:26
Output for 5.3.18 - 5.3.19
2015-11-25 16:09:282015-11-25 16:09:28
Output for 5.3.15 - 5.3.16
2015-11-25 16:09:312015-11-25 16:09:31
Output for 5.3.12 - 5.3.13
2015-11-25 16:09:342015-11-25 16:09:34
Output for 5.3.9 - 5.3.10
2015-11-25 16:09:372015-11-25 16:09:37
Output for 5.3.7 - 5.3.8
2015-11-25 16:09:382015-11-25 16:09:38
Output for 5.3.5 - 5.3.6
2015-11-25 16:09:392015-11-25 16:09:39
Output for 5.3.4
2015-11-25 16:09:402015-11-25 16:09:40
Output for 5.3.3
2015-11-25 16:09:412015-11-25 16:09:41
Output for 5.3.2
2015-11-25 16:09:422015-11-25 16:09:42
Output for 5.3.1
2015-11-25 16:09:442015-11-25 16:09:44
Output for 5.3.0
2015-11-25 16:09:452015-11-25 16:09:45
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::add() in /in/IL0vM on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/IL0vM 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/IL0vM 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/IL0vM on line 2