3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $runDateTime = new DateTime(); $updatedTime = new DateTime(); $updatedTime = $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 DDQKJ
Output for 5.6.28, 7.0.14 - 7.1.0
2014-10-16 16:53:432014-10-16 16:55:433
Output for 7.0.7
2014-10-16 18:53:432014-10-16 18:55:433
Output for 7.0.6
2016-05-02 23:23:362016-05-02 23:25:363
Output for 7.0.5
2016-04-02 12:57:352016-04-02 12:59:353
Output for 7.0.4
2016-03-09 21:46:572016-03-09 21:48:573
Output for 7.0.3
2016-03-17 22:11:222016-03-17 22:13:223
Output for 7.0.2
2016-03-21 08:56:202016-03-21 08:58:203
Output for 7.0.1
2016-03-23 08:34:442016-03-23 08:36:443
Output for 7.0.0
2016-03-26 11:47:532016-03-26 11:49:533
Output for hhvm-3.12.0
2016-03-11 00:54:532016-03-11 00:56:533
Output for hhvm-3.10.0
2016-03-29 15:18:442016-03-29 15:20:443
Output for 5.6.21
2016-05-01 18:28:242016-05-01 18:30:243
Output for 5.6.20
2016-04-09 08:16:502016-04-09 08:18:503
Output for 5.6.19
2016-03-06 18:44:502016-03-06 18:46:503
Output for 5.6.18
2016-03-14 07:11:272016-03-14 07:13:273
Output for 5.6.17
2016-03-19 02:45:022016-03-19 02:47:023
Output for 5.6.16
2016-03-27 13:30:142016-03-27 13:32:143
Output for 5.6.15
2016-03-28 14:20:232016-03-28 14:22:233
Output for 5.6.14
2016-04-01 17:14:102016-04-01 17:16:103
Output for 5.6.13
2016-04-14 21:10:472016-04-14 21:12:473
Output for 5.6.12
2016-04-19 10:10:082016-04-19 10:12:083
Output for 5.6.11
2016-04-22 17:31:342016-04-22 17:33:343
Output for 5.6.10
2016-04-24 19:08:542016-04-24 19:10:543
Output for 5.6.9
2016-04-27 00:05:072016-04-27 00:07:073
Output for 5.6.8
2016-04-29 07:44:142016-04-29 07:46:143
Output for 5.6.7
2016-05-24 17:14:462016-05-24 17:16:463
Output for 5.5.35
2016-05-21 21:35:022016-05-21 21:37:023
Output for 5.5.34
2016-04-10 13:41:012016-04-10 13:43:013
Output for 5.5.33
2016-03-08 08:55:022016-03-08 08:57:023
Output for 5.5.32
2016-03-15 18:00:222016-03-15 18:02:223
Output for 5.5.31
2016-03-20 05:42:362016-03-20 05:44:363
Output for 5.5.30
2016-03-31 16:33:082016-03-31 16:35:083
Output for 5.5.29
2016-04-16 11:01:062016-04-16 11:03:063
Output for 5.5.28
2016-04-20 13:13:272016-04-20 13:15:273
Output for 5.5.27
2016-04-21 16:01:132016-04-21 16:03:133
Output for 5.5.26
2016-04-25 21:21:372016-04-25 21:23:373
Output for 5.5.25
2016-04-28 03:25:442016-04-28 03:27:443
Output for 5.5.24
2016-04-30 11:11:392016-04-30 11:13:393
Output for 5.4.45
2015-09-21 15:03:302015-09-21 15:05:303
Output for 5.4.44
2015-09-21 15:03:252015-09-21 15:05:253
Output for 5.4.43
2015-09-21 15:03:202015-09-21 15:05:203
Output for 5.4.42
2015-07-09 09:24:092015-07-09 09:26:093
Output for 5.4.41
2015-07-09 09:24:072015-07-09 09:26:073
Output for 5.4.39 - 5.4.40
2015-07-09 09:24:022015-07-09 09:26:023
Output for 5.4.38
2015-07-09 09:24:002015-07-09 09:26:003
Output for 5.4.36 - 5.4.37
2015-07-09 09:23:582015-07-09 09:25:583
Output for 5.4.34 - 5.4.35
2015-07-09 09:23:572015-07-09 09:25:573
Output for 5.4.15 - 5.4.32
2014-10-16 16:53:482014-10-16 16:55:483
Output for 5.3.24 - 5.4.14
2014-10-16 16:53:492014-10-16 16:55:493
Output for 5.3.2 - 5.3.23
2014-10-16 16:53:502014-10-16 16:55:503
Output for 5.3.0 - 5.3.1
2014-10-16 16:53:512014-10-16 16:55:513
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::add() in /in/tP7L0 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/tP7L0 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/tP7L0 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/tP7L0 on line 2