3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time = new DateTime(); $sub = new DateInterval('PT1H'); echo $time->format('Y-m-d H:i:s'); $time->sub($sub); echo $time->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.12 - 7.1.0
2014-12-23 15:43:042014-12-23 14:43:04
Output for 7.0.6
2016-05-03 10:14:042016-05-03 09:14:04
Output for 7.0.5
2016-04-02 23:01:312016-04-02 22:01:31
Output for 7.0.4
2016-03-10 09:36:522016-03-10 08:36:52
Output for 7.0.3
2016-03-18 10:16:232016-03-18 09:16:23
Output for 7.0.2
2016-03-22 16:14:522016-03-22 15:14:52
Output for 7.0.1
2016-03-23 20:51:172016-03-23 19:51:17
Output for 7.0.0
2016-03-26 22:23:482016-03-26 21:23:48
Output for 5.6.21
2016-05-02 05:33:582016-05-02 04:33:58
Output for 5.6.20
2016-04-09 21:59:212016-04-09 20:59:21
Output for 5.6.19
2016-03-07 17:44:422016-03-07 16:44:42
Output for 5.6.18
2016-03-15 01:49:222016-03-15 00:49:22
Output for 5.6.17
2016-03-19 14:30:192016-03-19 13:30:19
Output for 5.6.16
2016-03-28 00:11:152016-03-27 23:11:15
Output for 5.6.15
2016-03-29 01:16:012016-03-29 00:16:01
Output for 5.6.14
2016-04-02 03:35:182016-04-02 02:35:18
Output for 5.6.13
2016-04-15 07:29:372016-04-15 06:29:37
Output for 5.6.12
2016-04-19 21:17:142016-04-19 20:17:14
Output for 5.6.11
2016-04-23 04:19:262016-04-23 03:19:26
Output for 5.6.10
2016-04-25 06:04:172016-04-25 05:04:17
Output for 5.6.9
2016-04-27 11:01:272016-04-27 10:01:27
Output for 5.6.8
2016-04-29 19:10:572016-04-29 18:10:57
Output for 5.5.35
2016-05-22 09:21:382016-05-22 08:21:38
Output for 5.5.34
2016-04-11 00:20:192016-04-10 23:20:19
Output for 5.5.33
2016-03-08 20:41:402016-03-08 19:41:40
Output for 5.5.32
2016-03-17 03:23:572016-03-17 02:23:57
Output for 5.5.31
2016-03-20 17:15:522016-03-20 16:15:52
Output for 5.5.30
2016-04-01 03:12:402016-04-01 02:12:40
Output for 5.5.29
2016-04-16 21:36:312016-04-16 20:36:31
Output for 5.5.28
2016-04-21 00:32:182016-04-20 23:32:18
Output for 5.5.27
2016-04-22 02:50:382016-04-22 01:50:38
Output for 5.5.26
2016-04-26 08:30:172016-04-26 07:30:17
Output for 5.5.25
2016-04-28 14:49:062016-04-28 13:49:06
Output for 5.5.24
2016-05-23 22:09:582016-05-23 21:09:58
Output for 5.4.45
2016-02-18 16:31:052016-02-18 15:31:05
Output for 5.4.42 - 5.4.44
2016-02-18 16:31:062016-02-18 15:31:06
Output for 5.4.40 - 5.4.41
2016-02-18 16:31:072016-02-18 15:31:07
Output for 5.4.38 - 5.4.39
2016-02-18 16:31:082016-02-18 15:31:08
Output for 5.4.35 - 5.4.37
2016-02-18 16:31:092016-02-18 15:31:09
Output for 5.4.34
2016-02-18 16:31:102016-02-18 15:31:10
Output for 5.3.29, 5.4.29 - 5.4.32
2016-02-18 16:31:112016-02-18 15:31:11
Output for 5.4.26 - 5.4.28
2016-02-18 16:31:122016-02-18 15:31:12
Output for 5.3.28, 5.4.23 - 5.4.25
2016-02-18 16:31:132016-02-18 15:31:13
Output for 5.4.20 - 5.4.22
2016-02-18 16:31:142016-02-18 15:31:14
Output for 5.3.27, 5.4.17 - 5.4.19
2016-02-18 16:31:152016-02-18 15:31:15
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.16
2016-02-18 16:31:162016-02-18 15:31:16
Output for 5.3.20 - 5.3.22, 5.4.11 - 5.4.12
2016-02-18 16:31:172016-02-18 15:31:17
Output for 5.3.17 - 5.3.19, 5.4.7 - 5.4.10
2016-02-18 16:31:182016-02-18 15:31:18
Output for 5.3.14 - 5.3.16, 5.4.3 - 5.4.6
2016-02-18 16:31:192016-02-18 15:31:19
Output for 5.3.9 - 5.3.13, 5.4.0 - 5.4.2
2016-02-18 16:31:202016-02-18 15:31:20
Output for 5.3.4 - 5.3.8
2016-02-18 16:31:212016-02-18 15:31:21
Output for 5.3.1 - 5.3.3
2016-02-18 16:31:222016-02-18 15:31:22
Output for 5.3.0
2016-02-18 16:31:232016-02-18 15:31:23
Output for 5.2.0 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/0T9Yr on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/0T9Yr 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/0T9Yr 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/0T9Yr on line 2