3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start = new DateTime(); $end = new DateTime(); $end->modify('+5 days'); $period = new DatePeriod($start, new DateInterval('P1D'), $end); foreach ($period as $dt) { echo $dt->format('c') . "\n"; } foreach ($period as $dt) { echo $dt->format('d') . "\n"; }
based on 36I1k
Output for 5.6.28, 7.0.14 - 7.1.0
2014-07-31T19:08:48+02:00 2014-08-01T19:08:48+02:00 2014-08-02T19:08:48+02:00 2014-08-03T19:08:48+02:00 2014-08-04T19:08:48+02:00 31 01 02 03 04
Output for 7.0.6
2016-05-03T17:30:30+02:00 2016-05-04T17:30:30+02:00 2016-05-05T17:30:30+02:00 2016-05-06T17:30:30+02:00 2016-05-07T17:30:30+02:00 03 04 05 06 07
Output for 7.0.5
2016-04-03T05:58:45+02:00 2016-04-04T05:58:45+02:00 2016-04-05T05:58:45+02:00 2016-04-06T05:58:45+02:00 2016-04-07T05:58:45+02:00 03 04 05 06 07
Output for 7.0.4
2016-03-10T17:40:34+01:00 2016-03-11T17:40:34+01:00 2016-03-12T17:40:34+01:00 2016-03-13T17:40:34+01:00 2016-03-14T17:40:34+01:00 10 11 12 13 14
Output for 7.0.3
2016-03-18T18:28:27+01:00 2016-03-19T18:28:27+01:00 2016-03-20T18:28:27+01:00 2016-03-21T18:28:27+01:00 2016-03-22T18:28:27+01:00 18 19 20 21 22
Output for 7.0.2
2016-03-23T00:51:18+01:00 2016-03-24T00:51:18+01:00 2016-03-25T00:51:18+01:00 2016-03-26T00:51:18+01:00 2016-03-27T00:51:18+01:00 23 24 25 26 27
Output for 7.0.1
2016-03-24T04:39:29+01:00 2016-03-25T04:39:29+01:00 2016-03-26T04:39:29+01:00 2016-03-27T04:39:29+02:00 2016-03-28T04:39:29+02:00 24 25 26 27 28
Output for 7.0.0
2016-03-27T06:36:06+02:00 2016-03-28T06:36:06+02:00 2016-03-29T06:36:06+02:00 2016-03-30T06:36:06+02:00 2016-03-31T06:36:06+02:00 27 28 29 30 31
Output for 5.6.21
2016-05-02T12:40:43+02:00 2016-05-03T12:40:43+02:00 2016-05-04T12:40:43+02:00 2016-05-05T12:40:43+02:00 2016-05-06T12:40:43+02:00 02 03 04 05 06
Output for 5.6.20
2016-04-10T04:57:25+02:00 2016-04-11T04:57:25+02:00 2016-04-12T04:57:25+02:00 2016-04-13T04:57:25+02:00 2016-04-14T04:57:25+02:00 10 11 12 13 14
Output for 5.6.19
2016-03-08T01:49:48+01:00 2016-03-09T01:49:48+01:00 2016-03-10T01:49:48+01:00 2016-03-11T01:49:48+01:00 2016-03-12T01:49:48+01:00 08 09 10 11 12
Output for 5.6.18
2016-03-15T10:24:04+01:00 2016-03-16T10:24:04+01:00 2016-03-17T10:24:04+01:00 2016-03-18T10:24:04+01:00 2016-03-19T10:24:04+01:00 15 16 17 18 19
Output for 5.6.17
2016-03-19T22:14:12+01:00 2016-03-20T22:14:12+01:00 2016-03-21T22:14:12+01:00 2016-03-22T22:14:12+01:00 2016-03-23T22:14:12+01:00 19 20 21 22 23
Output for 5.6.16
2016-03-28T07:23:25+02:00 2016-03-29T07:23:25+02:00 2016-03-30T07:23:25+02:00 2016-03-31T07:23:25+02:00 2016-04-01T07:23:25+02:00 28 29 30 31 01
Output for 5.6.15
2016-03-29T08:14:32+02:00 2016-03-30T08:14:32+02:00 2016-03-31T08:14:32+02:00 2016-04-01T08:14:32+02:00 2016-04-02T08:14:32+02:00 29 30 31 01 02
Output for 5.6.14
2016-04-02T10:08:57+02:00 2016-04-03T10:08:57+02:00 2016-04-04T10:08:57+02:00 2016-04-05T10:08:57+02:00 2016-04-06T10:08:57+02:00 02 03 04 05 06
Output for 5.6.13
2016-04-15T14:29:14+02:00 2016-04-16T14:29:14+02:00 2016-04-17T14:29:14+02:00 2016-04-18T14:29:14+02:00 2016-04-19T14:29:14+02:00 15 16 17 18 19
Output for 5.6.12
2016-04-20T04:56:57+02:00 2016-04-21T04:56:57+02:00 2016-04-22T04:56:57+02:00 2016-04-23T04:56:57+02:00 2016-04-24T04:56:57+02:00 20 21 22 23 24
Output for 5.6.11
2016-04-24T11:11:55+02:00 2016-04-25T11:11:55+02:00 2016-04-26T11:11:55+02:00 2016-04-27T11:11:55+02:00 2016-04-28T11:11:55+02:00 24 25 26 27 28
Output for 5.6.10
2016-04-25T13:22:49+02:00 2016-04-26T13:22:49+02:00 2016-04-27T13:22:49+02:00 2016-04-28T13:22:49+02:00 2016-04-29T13:22:49+02:00 25 26 27 28 29
Output for 5.6.9
2016-04-27T18:31:53+02:00 2016-04-28T18:31:53+02:00 2016-04-29T18:31:53+02:00 2016-04-30T18:31:53+02:00 2016-05-01T18:31:53+02:00 27 28 29 30 01
Output for 5.6.8
2016-04-30T03:24:28+02:00 2016-05-01T03:24:28+02:00 2016-05-02T03:24:28+02:00 2016-05-03T03:24:28+02:00 2016-05-04T03:24:28+02:00 30 01 02 03 04
Output for 5.5.35
2016-05-22T18:47:39+02:00 2016-05-23T18:47:39+02:00 2016-05-24T18:47:39+02:00 2016-05-25T18:47:39+02:00 2016-05-26T18:47:39+02:00 22 23 24 25 26
Output for 5.5.34
2016-04-11T07:10:50+02:00 2016-04-12T07:10:50+02:00 2016-04-13T07:10:50+02:00 2016-04-14T07:10:50+02:00 2016-04-15T07:10:50+02:00 11 12 13 14 15
Output for 5.5.33
2016-03-09T04:28:02+01:00 2016-03-10T04:28:02+01:00 2016-03-11T04:28:02+01:00 2016-03-12T04:28:02+01:00 2016-03-13T04:28:02+01:00 09 10 11 12 13
Output for 5.5.32
2016-03-17T14:06:12+01:00 2016-03-18T14:06:12+01:00 2016-03-19T14:06:12+01:00 2016-03-20T14:06:12+01:00 2016-03-21T14:06:12+01:00 17 18 19 20 21
Output for 5.5.31
2016-03-21T01:11:06+01:00 2016-03-22T01:11:06+01:00 2016-03-23T01:11:06+01:00 2016-03-24T01:11:06+01:00 2016-03-25T01:11:06+01:00 21 22 23 24 25
Output for 5.5.30
2016-04-01T10:07:51+02:00 2016-04-02T10:07:51+02:00 2016-04-03T10:07:51+02:00 2016-04-04T10:07:51+02:00 2016-04-05T10:07:51+02:00 01 02 03 04 05
Output for 5.5.29
2016-04-17T04:53:48+02:00 2016-04-18T04:53:48+02:00 2016-04-19T04:53:48+02:00 2016-04-20T04:53:48+02:00 2016-04-21T04:53:48+02:00 17 18 19 20 21
Output for 5.5.28
2016-04-21T08:09:34+02:00 2016-04-22T08:09:34+02:00 2016-04-23T08:09:34+02:00 2016-04-24T08:09:34+02:00 2016-04-25T08:09:34+02:00 21 22 23 24 25
Output for 5.5.27
2016-04-22T09:59:50+02:00 2016-04-23T09:59:50+02:00 2016-04-24T09:59:50+02:00 2016-04-25T09:59:50+02:00 2016-04-26T09:59:50+02:00 22 23 24 25 26
Output for 5.5.26
2016-04-26T16:05:00+02:00 2016-04-27T16:05:00+02:00 2016-04-28T16:05:00+02:00 2016-04-29T16:05:00+02:00 2016-04-30T16:05:00+02:00 26 27 28 29 30
Output for 5.5.25
2016-04-28T22:55:36+02:00 2016-04-29T22:55:36+02:00 2016-04-30T22:55:36+02:00 2016-05-01T22:55:36+02:00 2016-05-02T22:55:36+02:00 28 29 30 01 02
Output for 5.5.24
2016-05-24T05:34:19+02:00 2016-05-25T05:34:19+02:00 2016-05-26T05:34:19+02:00 2016-05-27T05:34:19+02:00 2016-05-28T05:34:19+02:00 24 25 26 27 28
Output for 5.4.45
2015-09-09T23:55:31+02:00 2015-09-10T23:55:31+02:00 2015-09-11T23:55:31+02:00 2015-09-12T23:55:31+02:00 2015-09-13T23:55:31+02:00 09 10 11 12 13
Output for 5.4.44
2015-08-29T22:20:28+02:00 2015-08-30T22:20:28+02:00 2015-08-31T22:20:28+02:00 2015-09-01T22:20:28+02:00 2015-09-02T22:20:28+02:00 29 30 31 01 02
Output for 5.4.43
2015-08-29T22:20:25+02:00 2015-08-30T22:20:25+02:00 2015-08-31T22:20:25+02:00 2015-09-01T22:20:25+02:00 2015-09-02T22:20:25+02:00 29 30 31 01 02
Output for 5.4.42
2015-08-29T22:20:24+02:00 2015-08-30T22:20:24+02:00 2015-08-31T22:20:24+02:00 2015-09-01T22:20:24+02:00 2015-09-02T22:20:24+02:00 29 30 31 01 02
Output for 5.4.41
2015-06-07T14:31:20+02:00 2015-06-08T14:31:20+02:00 2015-06-09T14:31:20+02:00 2015-06-10T14:31:20+02:00 2015-06-11T14:31:20+02:00 07 08 09 10 11
Output for 5.4.40
2015-05-14T08:42:56+02:00 2015-05-15T08:42:56+02:00 2015-05-16T08:42:56+02:00 2015-05-17T08:42:56+02:00 2015-05-18T08:42:56+02:00 14 15 16 17 18
Output for 5.4.39
2015-05-14T08:42:55+02:00 2015-05-15T08:42:55+02:00 2015-05-16T08:42:55+02:00 2015-05-17T08:42:55+02:00 2015-05-18T08:42:55+02:00 14 15 16 17 18
Output for 5.4.38
2015-02-28T00:55:26+01:00 2015-03-01T00:55:26+01:00 2015-03-02T00:55:26+01:00 2015-03-03T00:55:26+01:00 2015-03-04T00:55:26+01:00 28 01 02 03 04
Output for 5.4.36 - 5.4.37
2015-02-04T01:46:29+01:00 2015-02-05T01:46:29+01:00 2015-02-06T01:46:29+01:00 2015-02-07T01:46:29+01:00 2015-02-08T01:46:29+01:00 04 05 06 07 08
Output for 5.4.35
2014-11-14T14:38:48+01:00 2014-11-15T14:38:48+01:00 2014-11-16T14:38:48+01:00 2014-11-17T14:38:48+01:00 2014-11-18T14:38:48+01:00 14 15 16 17 18
Output for 5.4.34
2014-11-14T01:07:40+01:00 2014-11-15T01:07:40+01:00 2014-11-16T01:07:40+01:00 2014-11-17T01:07:40+01:00 2014-11-18T01:07:40+01:00 14 15 16 17 18
Output for 5.4.32
2014-08-28T15:33:01+02:00 2014-08-29T15:33:01+02:00 2014-08-30T15:33:01+02:00 2014-08-31T15:33:01+02:00 2014-09-01T15:33:01+02:00 28 29 30 31 01
Output for 5.4.30 - 5.4.31
2014-07-31T19:08:52+02:00 2014-08-01T19:08:52+02:00 2014-08-02T19:08:52+02:00 2014-08-03T19:08:52+02:00 2014-08-04T19:08:52+02:00 31 01 02 03 04
Output for 5.4.8 - 5.4.29
2014-07-31T19:08:53+02:00 2014-08-01T19:08:53+02:00 2014-08-02T19:08:53+02:00 2014-08-03T19:08:53+02:00 2014-08-04T19:08:53+02:00 31 01 02 03 04
Output for 5.3.17 - 5.3.28, 5.4.0 - 5.4.7
2014-07-31T19:08:54+02:00 2014-08-01T19:08:54+02:00 2014-08-02T19:08:54+02:00 2014-08-03T19:08:54+02:00 2014-08-04T19:08:54+02:00 31 01 02 03 04
Output for 5.3.29
2014-08-28T15:33:00+02:00 2014-08-29T15:33:00+02:00 2014-08-30T15:33:00+02:00 2014-08-31T15:33:00+02:00 2014-09-01T15:33:00+02:00 28 29 30 31 01
Output for 5.3.4 - 5.3.16
2014-07-31T19:08:55+02:00 2014-08-01T19:08:55+02:00 2014-08-02T19:08:55+02:00 2014-08-03T19:08:55+02:00 2014-08-04T19:08:55+02:00 31 01 02 03 04
Output for 5.3.0 - 5.3.3
2014-07-31T19:08:55+02:00 2014-08-01T19:08:55+02:00 2014-08-02T19:08:55+02:00 2014-08-03T19:08:55+02:00 2014-08-04T19:08:55+02:00
Output for 5.2.0 - 5.2.17
Fatal error: Class 'DatePeriod' not found in /in/1Omnl on line 7
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/1Omnl 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/1Omnl 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/1Omnl on line 3