3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $runDateTime = new DateTime(); $updatedTime = new DateTime(); $updatedTime = $updatedTime->sub(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 tP7L0
Output for 5.6.28, 7.0.14 - 7.1.0
2014-10-16 16:55:372014-10-16 16:53:37
Output for 7.0.6
2016-05-03 10:26:592016-05-03 10:24:59
Output for 7.0.5
2016-04-02 23:12:502016-04-02 23:10:50
Output for 7.0.4
2016-03-10 09:49:292016-03-10 09:47:29
Output for 7.0.3
2016-03-18 10:29:322016-03-18 10:27:32
Output for 7.0.2
2016-03-22 16:28:032016-03-22 16:26:03
Output for 7.0.1
2016-03-23 21:03:112016-03-23 21:01:11
Output for 7.0.0
2016-03-26 22:35:272016-03-26 22:33:27
Output for hhvm-3.12.0
2016-03-12 13:15:322016-03-12 13:13:32
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
2016-05-02 05:46:192016-05-02 05:44:19
Output for 5.6.20
2016-04-09 22:12:312016-04-09 22:10:31
Output for 5.6.19
2016-03-07 17:56:492016-03-07 17:54:49
Output for 5.6.18
2016-03-15 02:03:362016-03-15 02:01:36
Output for 5.6.17
2016-03-19 14:43:072016-03-19 14:41:07
Output for 5.6.16
2016-03-28 00:32:362016-03-28 00:30:36
Output for 5.6.15
2016-03-29 01:27:542016-03-29 01:25:54
Output for 5.6.14
2016-04-02 03:46:482016-04-02 03:44:48
Output for 5.6.13
2016-04-15 07:41:142016-04-15 07:39:14
Output for 5.6.12
2016-04-19 21:29:422016-04-19 21:27:42
Output for 5.6.11
2016-04-23 04:31:402016-04-23 04:29:40
Output for 5.6.10
2016-04-25 06:16:242016-04-25 06:14:24
Output for 5.6.9
2016-04-27 11:15:222016-04-27 11:13:22
Output for 5.6.8
2016-04-29 19:24:052016-04-29 19:22:05
Output for 5.5.35
2016-05-22 09:34:042016-05-22 09:32:04
Output for 5.5.34
2016-04-11 00:32:492016-04-11 00:30:49
Output for 5.5.33
2016-03-08 20:53:442016-03-08 20:51:44
Output for 5.5.32
2016-03-17 03:37:042016-03-17 03:35:04
Output for 5.5.31
2016-03-20 17:28:182016-03-20 17:26:18
Output for 5.5.30
2016-04-01 03:24:392016-04-01 03:22:39
Output for 5.5.29
2016-04-16 21:48:302016-04-16 21:46:30
Output for 5.5.28
2016-04-21 00:45:552016-04-21 00:43:55
Output for 5.5.27
2016-04-22 03:03:382016-04-22 03:01:38
Output for 5.5.26
2016-04-26 08:43:102016-04-26 08:41:10
Output for 5.5.25
2016-04-28 15:01:452016-04-28 14:59:45
Output for 5.5.24
2016-05-23 22:22:032016-05-23 22:20:03
Output for 5.4.45
2015-09-21 15:03:312015-09-21 15:01:31
Output for 5.4.44
2015-09-21 15:03:252015-09-21 15:01:25
Output for 5.4.43
2015-09-21 15:03:202015-09-21 15:01:20
Output for 5.4.42
2015-07-09 09:24:182015-07-09 09:22:18
Output for 5.4.41
2015-07-09 09:24:162015-07-09 09:22:16
Output for 5.4.40
2015-07-09 09:24:122015-07-09 09:22:12
Output for 5.4.39
2015-07-09 09:24:112015-07-09 09:22:11
Output for 5.4.38
2015-07-09 09:24:102015-07-09 09:22:10
Output for 5.4.35 - 5.4.37
2015-07-09 09:24:072015-07-09 09:22:07
Output for 5.4.34
2015-07-09 09:24:062015-07-09 09:22:06
Output for 5.4.30 - 5.4.32
2014-10-16 16:55:412014-10-16 16:53:41
Output for 5.4.10 - 5.4.29
2014-10-16 16:55:422014-10-16 16:53:42
Output for 5.3.20 - 5.4.9
2014-10-16 16:55:432014-10-16 16:53:43
Output for 5.3.0 - 5.3.19
2014-10-16 16:55:442014-10-16 16:53:44
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::sub() in /in/pckh6 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/pckh6 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/pckh6 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/pckh6 on line 2