3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime(); $expire = $now->add(new DateInterval('PT6H8M')); echo ($expire->format('Y-m-d H:i:s'));
based on 3dGJX
Output for 5.6.28, 7.0.14 - 7.1.0
2014-09-11 22:30:59
Output for 7.0.6
2016-05-03 23:41:15
Output for 7.0.5
2016-04-03 12:09:18
Output for 7.0.4
2016-03-10 23:51:16
Output for 7.0.3
2016-03-19 00:39:22
Output for 7.0.2
2016-03-23 07:02:17
Output for 7.0.1
2016-03-24 10:50:07
Output for 7.0.0
2016-03-27 12:46:46
Output for hhvm-3.12.0
2016-03-13 11:06:43
Output for hhvm-3.10.0
2016-03-31 06:14:11
Output for 5.6.21
2016-05-02 18:51:28
Output for 5.6.20
2016-04-10 11:08:06
Output for 5.6.19
2016-03-08 08:00:51
Output for 5.6.18
2016-03-15 16:34:57
Output for 5.6.17
2016-03-20 04:25:03
Output for 5.6.16
2016-03-28 13:34:04
Output for 5.6.15
2016-03-29 14:25:06
Output for 5.6.14
2016-04-02 16:19:25
Output for 5.6.13
2016-04-15 20:39:47
Output for 5.6.12
2016-04-20 11:07:24
Output for 5.6.11
2016-04-24 17:22:43
Output for 5.6.10
2016-04-25 19:33:26
Output for 5.6.9
2016-04-28 00:42:33
Output for 5.6.8
2016-04-30 09:35:02
Output for 5.5.35
2016-05-23 00:59:02
Output for 5.5.34
2016-04-11 13:21:28
Output for 5.5.33
2016-03-09 10:38:50
Output for 5.5.32
2016-03-17 20:17:13
Output for 5.5.31
2016-03-21 07:22:05
Output for 5.5.30
2016-04-01 16:18:31
Output for 5.5.29
2016-04-17 11:04:25
Output for 5.5.28
2016-04-21 14:20:01
Output for 5.5.27
2016-04-22 16:10:27
Output for 5.5.26
2016-04-26 22:15:30
Output for 5.5.25
2016-04-29 05:06:17
Output for 5.5.24
2016-05-24 11:44:32
Output for 5.4.45
2015-09-21 19:41:41
Output for 5.4.44
2015-09-21 19:41:34
Output for 5.4.43
2015-09-21 19:41:26
Output for 5.4.42
2015-09-21 19:41:24
Output for 5.4.41
2015-09-21 19:41:20
Output for 5.4.40
2015-09-21 19:41:17
Output for 5.4.39
2015-09-21 19:41:14
Output for 5.4.38
2015-03-14 17:46:49
Output for 5.4.35 - 5.4.37
2015-03-14 17:46:42
Output for 5.4.34
2015-03-14 17:46:41
Output for 5.4.29 - 5.4.32
2014-09-11 22:31:03
Output for 5.4.7 - 5.4.28
2014-09-11 22:31:04
Output for 5.3.16 - 5.4.6
2014-09-11 22:31:05
Output for 5.3.0 - 5.3.15
2014-09-11 22:31:06
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::add() in /in/7NBWO on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/7NBWO 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/7NBWO 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/7NBWO on line 2