3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); $date->add(new DateInterval('P10D')); echo $date->format('Y-m-d H:i:s') . "\n";
Output for 5.6.28, 7.0.14 - 7.1.0
2014-05-16 22:17:25
Output for 7.0.6
2016-05-13 06:53:23
Output for 7.0.5
2016-04-12 19:53:53
Output for 7.0.4
2016-03-20 06:01:43
Output for 7.0.3
2016-03-28 06:28:26
Output for 7.0.2
2016-04-01 12:00:10
Output for 7.0.1
2016-04-02 17:24:23
Output for 7.0.0
2016-04-05 19:06:37
Output for 5.6.21
2016-05-12 02:10:29
Output for 5.6.20
2016-04-19 15:10:38
Output for 5.6.19
2016-03-17 07:00:18
Output for 5.6.18
2016-03-24 20:06:40
Output for 5.6.17
2016-03-29 10:49:05
Output for 5.6.16
2016-04-06 20:51:32
Output for 5.6.15
2016-04-07 21:43:56
Output for 5.6.14
2016-04-12 00:12:35
Output for 5.6.13
2016-04-25 04:16:39
Output for 5.6.12
2016-04-29 17:48:02
Output for 5.6.11
2016-05-03 00:46:14
Output for 5.6.10
2016-05-05 02:37:36
Output for 5.6.9
2016-05-07 07:36:13
Output for 5.6.8
2016-05-09 15:29:56
Output for 5.6.7
2016-06-04 07:22:53
Output for 5.5.35
2016-06-01 05:48:03
Output for 5.5.34
2016-04-20 21:08:17
Output for 5.5.33
2016-03-18 16:55:39
Output for 5.5.32
2016-03-26 22:58:18
Output for 5.5.31
2016-03-30 13:37:52
Output for 5.5.30
2016-04-10 23:43:49
Output for 5.5.29
2016-04-26 18:21:47
Output for 5.5.28
2016-04-30 20:51:54
Output for 5.5.27
2016-05-01 23:18:42
Output for 5.5.26
2016-05-06 05:03:40
Output for 5.5.25
2016-05-08 11:06:05
Output for 5.5.24
2016-06-02 18:00:13
Output for 5.4.45
2015-09-30 23:16:55
Output for 5.4.44
2015-09-30 23:16:51
Output for 5.4.43
2015-08-08 18:08:14
Output for 5.4.42
2015-08-08 18:08:13
Output for 5.4.41
2015-05-25 15:01:28
Output for 5.4.39 - 5.4.40
2015-05-25 15:01:22
Output for 5.4.38
2015-03-13 00:00:32
Output for 5.4.37
2015-02-19 07:56:16
Output for 5.4.34 - 5.4.36
2015-02-19 07:56:15
Output for 5.4.32
2014-09-19 16:08:50
Output for 5.4.31
2014-09-19 16:08:49
Output for 5.4.29 - 5.4.30
2014-09-19 16:08:45
Output for 5.4.22 - 5.4.28
2014-05-16 22:17:26
Output for 5.4.3 - 5.4.21
2014-05-16 22:17:27
Output for 5.3.13 - 5.3.28, 5.4.0 - 5.4.2
2014-05-16 22:17:28
Output for 5.3.29
2014-09-19 16:08:46
Output for 5.3.0 - 5.3.12
2014-05-16 22:17:29
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::add() in /in/v32pU on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/v32pU on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/v32pU on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/v32pU on line 3