3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time = new DateTime(); $sub = new DateInterval('PT3H'); $time->sub($sub); echo $time->format('c');
based on HVvck
Output for 5.6.28, 7.0.14 - 7.1.0
2014-11-27T14:03:00+01:00
Output for 7.0.6
2016-05-03T14:16:20+02:00
Output for 7.0.5
2016-04-03T02:45:16+02:00
Output for 7.0.4
2016-03-10T14:26:31+01:00
Output for 7.0.3
2016-03-18T15:12:39+01:00
Output for 7.0.2
2016-03-22T21:26:03+01:00
Output for 7.0.1
2016-03-24T01:25:32+01:00
Output for 7.0.0
2016-03-27T03:22:08+02:00
Output for 5.6.21
2016-05-02T09:26:35+02:00
Output for 5.6.20
2016-04-10T01:43:43+02:00
Output for 5.6.19
2016-03-07T22:34:28+01:00
Output for 5.6.18
2016-03-15T07:06:09+01:00
Output for 5.6.17
2016-03-19T18:58:59+01:00
Output for 5.6.16
2016-03-28T04:09:43+02:00
Output for 5.6.15
2016-03-29T05:00:39+02:00
Output for 5.6.14
2016-04-02T06:55:38+02:00
Output for 5.6.13
2016-04-15T11:15:11+02:00
Output for 5.6.12
2016-04-20T01:42:23+02:00
Output for 5.6.11
2016-04-24T07:54:45+02:00
Output for 5.6.10
2016-04-25T10:08:28+02:00
Output for 5.6.9
2016-04-27T15:17:28+02:00
Output for 5.6.8
2016-04-30T00:10:06+02:00
Output for 5.5.35
2016-05-22T15:28:18+02:00
Output for 5.5.34
2016-04-11T03:57:16+02:00
Output for 5.5.33
2016-03-09T01:13:24+01:00
Output for 5.5.32
2016-03-17T10:50:42+01:00
Output for 5.5.31
2016-03-20T21:55:00+01:00
Output for 5.5.30
2016-04-01T06:53:42+02:00
Output for 5.5.29
2016-04-17T01:39:56+02:00
Output for 5.5.28
2016-04-21T04:53:51+02:00
Output for 5.5.27
2016-04-22T06:46:13+02:00
Output for 5.5.26
2016-04-26T12:49:51+02:00
Output for 5.5.25
2016-04-28T19:40:57+02:00
Output for 5.5.24
2016-05-24T02:21:10+02:00
Output for 5.4.42 - 5.4.45
2015-10-12T17:03:13+02:00
Output for 5.4.36 - 5.4.41
2015-10-12T17:03:14+02:00
Output for 5.4.31 - 5.4.35
2015-10-12T17:03:15+02:00
Output for 5.4.28 - 5.4.30
2015-10-12T17:03:16+02:00
Output for 5.4.24 - 5.4.27
2015-10-12T17:03:17+02:00
Output for 5.4.17 - 5.4.23
2015-10-12T17:03:18+02:00
Output for 5.4.11 - 5.4.16
2015-10-12T17:03:19+02:00
Output for 5.4.3 - 5.4.10
2015-10-12T17:03:20+02:00
Output for 5.3.28 - 5.4.2
2015-10-12T17:03:21+02:00
Output for 5.3.23 - 5.3.27
2015-10-12T17:03:22+02:00
Output for 5.3.17 - 5.3.22
2015-10-12T17:03:23+02:00
Output for 5.3.10 - 5.3.16
2015-10-12T17:03:24+02:00
Output for 5.3.5 - 5.3.9
2015-10-12T17:03:25+02:00
Output for 5.3.0 - 5.3.4
2015-10-12T17:03:26+02:00
Output for 5.2.0 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/SvLS0 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/SvLS0 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/SvLS0 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/SvLS0 on line 2