3v4l.org

run code in 300+ PHP versions simultaneously
<?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; }
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
2014-10-16 16:53:362014-10-16 16:53:36
Output for 7.3.32 - 7.3.33, 8.0.13
2014-10-16 14:53:362014-10-16 14:53:36
Output for 5.3.29
2015-11-25 16:09:032015-11-25 16:09:03
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.26
2015-11-25 16:09:202015-11-25 16:09:20
Output for 5.3.24 - 5.3.25
2015-11-25 16:09:222015-11-25 16:09:22
Output for 5.3.23
2015-11-25 16:09:232015-11-25 16:09:23
Output for 5.3.22
2015-11-25 16:09:242015-11-25 16:09:24
Output for 5.3.21
2015-11-25 16:09:252015-11-25 16:09:25
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.17
2015-11-25 16:09:292015-11-25 16:09:29
Output for 5.3.15 - 5.3.16
2015-11-25 16:09:312015-11-25 16:09:31
Output for 5.3.14
2015-11-25 16:09:322015-11-25 16:09:32
Output for 5.3.12 - 5.3.13
2015-11-25 16:09:342015-11-25 16:09:34
Output for 5.3.11
2015-11-25 16:09:352015-11-25 16:09:35
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.0.5, 5.1.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.3.11, 4.4.0 - 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

preferences:
355.75 ms | 401 KiB | 459 Q