3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime(); echo $date->format('c') . "\n"; $date = new \DateTime('+4 hours'); echo $date->format('c') . "\n";
based on ShCdd
Output for 5.6.28, 7.0.20 - 7.2.0
2015-11-04T19:58:28+01:00 2015-11-04T23:58:28+01:00
Output for 7.0.6
2016-05-03T18:19:52+02:00 2016-05-03T22:19:52+02:00
Output for 7.0.5
2016-04-03T06:45:33+02:00 2016-04-03T10:45:33+02:00
Output for 7.0.4
2016-03-10T18:31:51+01:00 2016-03-10T22:31:51+01:00
Output for 7.0.3
2016-03-18T19:39:17+01:00 2016-03-18T23:39:17+01:00
Output for 7.0.2
2016-03-23T01:46:49+01:00 2016-03-23T05:46:49+01:00
Output for 7.0.1
2016-03-24T05:27:24+01:00 2016-03-24T09:27:24+01:00
Output for 7.0.0
2016-03-27T07:23:46+02:00 2016-03-27T11:23:46+02:00
Output for 5.6.21
2016-05-02T13:29:16+02:00 2016-05-02T17:29:16+02:00
Output for 5.6.20
2016-04-10T05:44:55+02:00 2016-04-10T09:44:55+02:00
Output for 5.6.19
2016-03-08T02:42:50+01:00 2016-03-08T06:42:50+01:00
Output for 5.6.18
2016-03-15T11:25:55+01:00 2016-03-15T15:25:55+01:00
Output for 5.6.17
2016-03-19T23:05:35+01:00 2016-03-20T03:05:35+01:00
Output for 5.6.16
2016-03-28T08:11:06+02:00 2016-03-28T12:11:06+02:00
Output for 5.6.15
2016-03-29T09:01:40+02:00 2016-03-29T13:01:40+02:00
Output for 5.6.14
2016-04-02T10:53:20+02:00 2016-04-02T14:53:20+02:00
Output for 5.6.13
2016-04-15T15:16:37+02:00 2016-04-15T19:16:37+02:00
Output for 5.6.12
2016-04-20T05:45:40+02:00 2016-04-20T09:45:40+02:00
Output for 5.6.11
2016-04-24T12:07:30+02:00 2016-04-24T16:07:30+02:00
Output for 5.6.10
2016-04-25T14:11:08+02:00 2016-04-25T18:11:08+02:00
Output for 5.6.9
2016-04-27T19:21:06+02:00 2016-04-27T23:21:06+02:00
Output for 5.6.8
2016-04-30T04:13:45+02:00 2016-04-30T08:13:45+02:00
Output for 5.5.35
2016-05-22T20:19:20+02:00 2016-05-23T00:19:20+02:00
Output for 5.5.34
2016-04-11T07:56:38+02:00 2016-04-11T11:56:38+02:00
Output for 5.5.33
2016-03-09T05:24:27+01:00 2016-03-09T09:24:27+01:00
Output for 5.5.32
2016-03-17T15:20:18+01:00 2016-03-17T19:20:18+01:00
Output for 5.5.31
2016-03-21T02:06:43+01:00 2016-03-21T06:06:43+01:00
Output for 5.5.30
2016-04-01T10:55:16+02:00 2016-04-01T14:55:16+02:00
Output for 5.5.29
2016-04-17T05:40:24+02:00 2016-04-17T09:40:24+02:00
Output for 5.5.28
2016-04-21T08:59:03+02:00 2016-04-21T12:59:03+02:00
Output for 5.5.27
2016-04-22T10:46:24+02:00 2016-04-22T14:46:24+02:00
Output for 5.5.26
2016-04-26T16:53:46+02:00 2016-04-26T20:53:46+02:00
Output for 5.5.25
2016-04-28T23:46:04+02:00 2016-04-29T03:46:04+02:00
Output for 5.5.24
2016-05-24T06:19:24+02:00 2016-05-24T10:19:24+02:00
Output for 5.4.44 - 5.4.45
2015-11-04T19:58:36+01:00 2015-11-04T23:58:36+01:00
Output for 5.4.35 - 5.4.43
2015-11-04T19:58:37+01:00 2015-11-04T23:58:37+01:00
Output for 5.4.25 - 5.4.34
2015-11-04T19:58:38+01:00 2015-11-04T23:58:38+01:00
Output for 5.4.15 - 5.4.24
2015-11-04T19:58:39+01:00 2015-11-04T23:58:39+01:00
Output for 5.4.5 - 5.4.14
2015-11-04T19:58:40+01:00 2015-11-04T23:58:40+01:00
Output for 5.3.25 - 5.4.4
2015-11-04T19:58:41+01:00 2015-11-04T23:58:41+01:00
Output for 5.3.19 - 5.3.24
2015-11-04T19:58:42+01:00 2015-11-04T23:58:42+01:00