3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $period = new DatePeriod(new DateTime(), new DateInterval('P1D'), (new DateTime())->modify('+5 days')); foreach ($period as $dt) { echo $dt->format('c') . "\n"; } foreach ($period as $dt) { echo $dt->format('d') . "\n"; }
based on 4Pqcb
Output for 5.6.28, 7.0.14 - 7.1.0
2014-07-31T19:07:03+02:00 2014-08-01T19:07:03+02:00 2014-08-02T19:07:03+02:00 2014-08-03T19:07:03+02:00 2014-08-04T19:07:03+02:00 31 01 02 03 04
Output for 7.0.6
2016-05-03T17:30:34+02:00 2016-05-04T17:30:34+02:00 2016-05-05T17:30:34+02:00 2016-05-06T17:30:34+02:00 2016-05-07T17:30:34+02:00 03 04 05 06 07
Output for 7.0.5
2016-04-03T05:58:51+02:00 2016-04-04T05:58:51+02:00 2016-04-05T05:58:51+02:00 2016-04-06T05:58:51+02:00 2016-04-07T05:58:51+02:00 03 04 05 06 07
Output for 7.0.4
2016-03-10T17:40:38+01:00 2016-03-11T17:40:38+01:00 2016-03-12T17:40:38+01:00 2016-03-13T17:40:38+01:00 2016-03-14T17:40:38+01:00 10 11 12 13 14
Output for 7.0.3
2016-03-18T18:28:32+01:00 2016-03-19T18:28:32+01:00 2016-03-20T18:28:32+01:00 2016-03-21T18:28:32+01:00 2016-03-22T18:28:32+01:00 18 19 20 21 22
Output for 7.0.2
2016-03-23T00:51:23+01:00 2016-03-24T00:51:23+01:00 2016-03-25T00:51:23+01:00 2016-03-26T00:51:23+01:00 2016-03-27T00:51:23+01:00 23 24 25 26 27
Output for 7.0.1
2016-03-24T04:39:33+01:00 2016-03-25T04:39:33+01:00 2016-03-26T04:39:33+01:00 2016-03-27T04:39:33+02:00 2016-03-28T04:39:33+02:00 24 25 26 27 28
Output for 7.0.0
2016-03-27T06:36:10+02:00 2016-03-28T06:36:10+02:00 2016-03-29T06:36:10+02:00 2016-03-30T06:36:10+02:00 2016-03-31T06:36:10+02:00 27 28 29 30 31
Output for 5.6.21
2016-05-02T12:40:46+02:00 2016-05-03T12:40:46+02:00 2016-05-04T12:40:46+02:00 2016-05-05T12:40:46+02:00 2016-05-06T12:40:46+02:00 02 03 04 05 06
Output for 5.6.20
2016-04-10T04:57:29+02:00 2016-04-11T04:57:29+02:00 2016-04-12T04:57:29+02:00 2016-04-13T04:57:29+02:00 2016-04-14T04:57:29+02:00 10 11 12 13 14
Output for 5.6.19
2016-03-08T01:49:52+01:00 2016-03-09T01:49:52+01:00 2016-03-10T01:49:52+01:00 2016-03-11T01:49:52+01:00 2016-03-12T01:49:52+01:00 08 09 10 11 12
Output for 5.6.18
2016-03-15T10:24:07+01:00 2016-03-16T10:24:07+01:00 2016-03-17T10:24:07+01:00 2016-03-18T10:24:07+01:00 2016-03-19T10:24:07+01:00 15 16 17 18 19
Output for 5.6.17
2016-03-19T22:14:17+01:00 2016-03-20T22:14:17+01:00 2016-03-21T22:14:17+01:00 2016-03-22T22:14:17+01:00 2016-03-23T22:14:17+01:00 19 20 21 22 23
Output for 5.6.16
2016-03-28T07:23:29+02:00 2016-03-29T07:23:29+02:00 2016-03-30T07:23:29+02:00 2016-03-31T07:23:29+02:00 2016-04-01T07:23:29+02:00 28 29 30 31 01
Output for 5.6.15
2016-03-29T08:14:36+02:00 2016-03-30T08:14:36+02:00 2016-03-31T08:14:36+02:00 2016-04-01T08:14:36+02:00 2016-04-02T08:14:36+02:00 29 30 31 01 02
Output for 5.6.14
2016-04-02T10:09:01+02:00 2016-04-03T10:09:01+02:00 2016-04-04T10:09:01+02:00 2016-04-05T10:09:01+02:00 2016-04-06T10:09:01+02:00 02 03 04 05 06
Output for 5.6.13
2016-04-15T14:29:18+02:00 2016-04-16T14:29:18+02:00 2016-04-17T14:29:18+02:00 2016-04-18T14:29:18+02:00 2016-04-19T14:29:18+02:00 15 16 17 18 19
Output for 5.6.12
2016-04-20T04:57:01+02:00 2016-04-21T04:57:01+02:00 2016-04-22T04:57:01+02:00 2016-04-23T04:57:01+02:00 2016-04-24T04:57:01+02:00 20 21 22 23 24
Output for 5.6.11
2016-04-24T11:11:59+02:00 2016-04-25T11:11:59+02:00 2016-04-26T11:11:59+02:00 2016-04-27T11:11:59+02:00 2016-04-28T11:11:59+02:00 24 25 26 27 28
Output for 5.6.10
2016-04-25T13:22:53+02:00 2016-04-26T13:22:53+02:00 2016-04-27T13:22:53+02:00 2016-04-28T13:22:53+02:00 2016-04-29T13:22:53+02:00 25 26 27 28 29
Output for 5.6.9
2016-04-27T18:31:57+02:00 2016-04-28T18:31:57+02:00 2016-04-29T18:31:57+02:00 2016-04-30T18:31:57+02:00 2016-05-01T18:31:57+02:00 27 28 29 30 01
Output for 5.6.8
2016-04-30T03:24:31+02:00 2016-05-01T03:24:31+02:00 2016-05-02T03:24:31+02:00 2016-05-03T03:24:31+02:00 2016-05-04T03:24:31+02:00 30 01 02 03 04
Output for 5.5.35
2016-05-22T18:47:44+02:00 2016-05-23T18:47:44+02:00 2016-05-24T18:47:44+02:00 2016-05-25T18:47:44+02:00 2016-05-26T18:47:44+02:00 22 23 24 25 26
Output for 5.5.34
2016-04-11T07:10:54+02:00 2016-04-12T07:10:54+02:00 2016-04-13T07:10:54+02:00 2016-04-14T07:10:54+02:00 2016-04-15T07:10:54+02:00 11 12 13 14 15
Output for 5.5.33
2016-03-09T04:28:06+01:00 2016-03-10T04:28:06+01:00 2016-03-11T04:28:06+01:00 2016-03-12T04:28:06+01:00 2016-03-13T04:28:06+01:00 09 10 11 12 13
Output for 5.5.32
2016-03-17T14:06:17+01:00 2016-03-18T14:06:17+01:00 2016-03-19T14:06:17+01:00 2016-03-20T14:06:17+01:00 2016-03-21T14:06:17+01:00 17 18 19 20 21
Output for 5.5.31
2016-03-21T01:11:10+01:00 2016-03-22T01:11:10+01:00 2016-03-23T01:11:10+01:00 2016-03-24T01:11:10+01:00 2016-03-25T01:11:10+01:00 21 22 23 24 25
Output for 5.5.30
2016-04-01T10:07:55+02:00 2016-04-02T10:07:55+02:00 2016-04-03T10:07:55+02:00 2016-04-04T10:07:55+02:00 2016-04-05T10:07:55+02:00 01 02 03 04 05
Output for 5.5.29
2016-04-17T04:53:53+02:00 2016-04-18T04:53:53+02:00 2016-04-19T04:53:53+02:00 2016-04-20T04:53:53+02:00 2016-04-21T04:53:53+02:00 17 18 19 20 21
Output for 5.5.28
2016-04-21T08:09:38+02:00 2016-04-22T08:09:38+02:00 2016-04-23T08:09:38+02:00 2016-04-24T08:09:38+02:00 2016-04-25T08:09:38+02:00 21 22 23 24 25
Output for 5.5.27
2016-04-22T09:59:53+02:00 2016-04-23T09:59:53+02:00 2016-04-24T09:59:53+02:00 2016-04-25T09:59:53+02:00 2016-04-26T09:59:53+02:00 22 23 24 25 26
Output for 5.5.26
2016-04-26T16:05:05+02:00 2016-04-27T16:05:05+02:00 2016-04-28T16:05:05+02:00 2016-04-29T16:05:05+02:00 2016-04-30T16:05:05+02:00 26 27 28 29 30
Output for 5.5.25
2016-04-28T22:55:55+02:00 2016-04-29T22:55:55+02:00 2016-04-30T22:55:55+02:00 2016-05-01T22:55:55+02:00 2016-05-02T22:55:55+02:00 28 29 30 01 02
Output for 5.5.24
2016-05-24T05:34:24+02:00 2016-05-25T05:34:24+02:00 2016-05-26T05:34:24+02:00 2016-05-27T05:34:24+02:00 2016-05-28T05:34:24+02:00 24 25 26 27 28
Output for 5.4.45
2015-09-09T23:56:42+02:00 2015-09-10T23:56:42+02:00 2015-09-11T23:56:42+02:00 2015-09-12T23:56:42+02:00 2015-09-13T23:56:42+02:00 09 10 11 12 13
Output for 5.4.44
2015-08-29T22:21:14+02:00 2015-08-30T22:21:14+02:00 2015-08-31T22:21:14+02:00 2015-09-01T22:21:14+02:00 2015-09-02T22:21:14+02:00 29 30 31 01 02
Output for 5.4.43
2015-08-29T22:21:11+02:00 2015-08-30T22:21:11+02:00 2015-08-31T22:21:11+02:00 2015-09-01T22:21:11+02:00 2015-09-02T22:21:11+02:00 29 30 31 01 02
Output for 5.4.42
2015-08-29T22:21:10+02:00 2015-08-30T22:21:10+02:00 2015-08-31T22:21:10+02:00 2015-09-01T22:21:10+02:00 2015-09-02T22:21:10+02:00 29 30 31 01 02
Output for 5.4.41
2015-06-07T14:32:01+02:00 2015-06-08T14:32:01+02:00 2015-06-09T14:32:01+02:00 2015-06-10T14:32:01+02:00 2015-06-11T14:32:01+02:00 07 08 09 10 11
Output for 5.4.40
2015-05-14T08:44:33+02:00 2015-05-15T08:44:33+02:00 2015-05-16T08:44:33+02:00 2015-05-17T08:44:33+02:00 2015-05-18T08:44:33+02:00 14 15 16 17 18
Output for 5.4.39
2015-05-14T08:44:32+02:00 2015-05-15T08:44:32+02:00 2015-05-16T08:44:32+02:00 2015-05-17T08:44:32+02:00 2015-05-18T08:44:32+02:00 14 15 16 17 18
Output for 5.4.38
2015-02-28T00:56:12+01:00 2015-03-01T00:56:12+01:00 2015-03-02T00:56:12+01:00 2015-03-03T00:56:12+01:00 2015-03-04T00:56:12+01:00 28 01 02 03 04
Output for 5.4.37
2015-02-04T01:46:27+01:00 2015-02-05T01:46:27+01:00 2015-02-06T01:46:27+01:00 2015-02-07T01:46:27+01:00 2015-02-08T01:46:27+01:00 04 05 06 07 08
Output for 5.4.36
2015-02-04T01:46:26+01:00 2015-02-05T01:46:26+01:00 2015-02-06T01:46:26+01:00 2015-02-07T01:46:26+01:00 2015-02-08T01:46:26+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:37+01:00 2014-11-15T01:07:37+01:00 2014-11-16T01:07:37+01:00 2014-11-17T01:07:37+01:00 2014-11-18T01:07:37+01:00 14 15 16 17 18
Output for 5.4.32
2014-08-28T15:32:59+02:00 2014-08-29T15:32:59+02:00 2014-08-30T15:32:59+02:00 2014-08-31T15:32:59+02:00 2014-09-01T15:32:59+02:00 28 29 30 31 01
Output for 5.4.15 - 5.4.31
2014-07-31T19:07:07+02:00 2014-08-01T19:07:07+02:00 2014-08-02T19:07:07+02:00 2014-08-03T19:07:07+02:00 2014-08-04T19:07:07+02:00 31 01 02 03 04
Output for 5.4.0 - 5.4.14
2014-07-31T19:07:08+02:00 2014-08-01T19:07:08+02:00 2014-08-02T19:07:08+02:00 2014-08-03T19:07:08+02:00 2014-08-04T19:07:08+02:00 31 01 02 03 04
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/36I1k on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/36I1k on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/36I1k on line 3
Process exited with code 255.