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"; echo $date->format('Y') . "\n";
based on Zvi5P
Output for 5.6.28, 7.0.20 - 7.2.0
2015-11-04T20:01:13+01:00 2015-11-05T00:01:13+01:00 2015
Output for 7.0.6
2016-05-03T18:19:53+02:00 2016-05-03T22:19:53+02:00 2016
Output for 7.0.5
2016-04-03T06:45:34+02:00 2016-04-03T10:45:34+02:00 2016
Output for 7.0.4
2016-03-10T18:31:51+01:00 2016-03-10T22:31:51+01:00 2016
Output for 7.0.3
2016-03-18T19:39:18+01:00 2016-03-18T23:39:18+01:00 2016
Output for 7.0.2
2016-03-23T01:46:50+01:00 2016-03-23T05:46:50+01:00 2016
Output for 7.0.1
2016-03-24T05:27:25+01:00 2016-03-24T09:27:25+01:00 2016
Output for 7.0.0
2016-03-27T07:23:46+02:00 2016-03-27T11:23:46+02:00 2016
Output for 5.6.21
2016-05-02T13:29:17+02:00 2016-05-02T17:29:17+02:00 2016
Output for 5.6.20
2016-04-10T05:44:56+02:00 2016-04-10T09:44:56+02:00 2016
Output for 5.6.19
2016-03-08T02:42:50+01:00 2016-03-08T06:42:50+01:00 2016
Output for 5.6.18
2016-03-15T11:25:57+01:00 2016-03-15T15:25:57+01:00 2016
Output for 5.6.17
2016-03-19T23:05:36+01:00 2016-03-20T03:05:36+01:00 2016
Output for 5.6.16
2016-03-28T08:11:06+02:00 2016-03-28T12:11:06+02:00 2016
Output for 5.6.15
2016-03-29T09:01:41+02:00 2016-03-29T13:01:41+02:00 2016
Output for 5.6.14
2016-04-02T10:53:20+02:00 2016-04-02T14:53:20+02:00 2016
Output for 5.6.13
2016-04-15T15:16:38+02:00 2016-04-15T19:16:38+02:00 2016
Output for 5.6.12
2016-04-20T05:45:41+02:00 2016-04-20T09:45:41+02:00 2016
Output for 5.6.11
2016-04-24T12:07:31+02:00 2016-04-24T16:07:31+02:00 2016
Output for 5.6.10
2016-04-25T14:11:08+02:00 2016-04-25T18:11:08+02:00 2016
Output for 5.6.9
2016-04-27T19:21:07+02:00 2016-04-27T23:21:07+02:00 2016
Output for 5.6.8
2016-04-30T04:13:46+02:00 2016-04-30T08:13:46+02:00 2016
Output for 5.5.35
2016-05-22T20:19:25+02:00 2016-05-23T00:19:25+02:00 2016
Output for 5.5.34
2016-04-11T07:56:39+02:00 2016-04-11T11:56:39+02:00 2016
Output for 5.5.33
2016-03-09T05:24:29+01:00 2016-03-09T09:24:29+01:00 2016
Output for 5.5.32
2016-03-17T15:20:19+01:00 2016-03-17T19:20:19+01:00 2016
Output for 5.5.31
2016-03-21T02:06:44+01:00 2016-03-21T06:06:44+01:00 2016
Output for 5.5.30
2016-04-01T10:55:17+02:00 2016-04-01T14:55:17+02:00 2016
Output for 5.5.29
2016-04-17T05:40:25+02:00 2016-04-17T09:40:25+02:00 2016
Output for 5.5.28
2016-04-21T08:59:04+02:00 2016-04-21T12:59:04+02:00 2016
Output for 5.5.27
2016-04-22T10:46:25+02:00 2016-04-22T14:46:25+02:00 2016
Output for 5.5.26
2016-04-26T16:53:47+02:00 2016-04-26T20:53:47+02:00 2016
Output for 5.5.25
2016-04-28T23:46:05+02:00 2016-04-29T03:46:05+02:00 2016
Output for 5.5.24
2016-05-24T16:18:37+02:00 2016-05-24T20:18:37+02:00 2016
Output for 5.4.37 - 5.4.45
2015-11-04T20:01:21+01:00 2015-11-05T00:01:21+01:00 2015
Output for 5.4.25 - 5.4.36
2015-11-04T20:01:22+01:00 2015-11-05T00:01:22+01:00 2015
Output for 5.4.16 - 5.4.24
2015-11-04T20:01:23+01:00 2015-11-05T00:01:23+01:00 2015
Output for 5.4.7 - 5.4.15
2015-11-04T20:01:24+01:00 2015-11-05T00:01:24+01:00 2015
Output for 5.3.28 - 5.4.6
2015-11-04T20:01:25+01:00 2015-11-05T00:01:25+01:00 2015
Output for 5.3.19 - 5.3.27
2015-11-04T20:01:26+01:00 2015-11-05T00:01:26+01:00 2015