3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $begin = new DateTime( '2007-10-20' ); $end = new DateTime( '2007-12-31' ); $interval = DateInterval::createFromDateString('1 month'); //$interval = new DateInterval('P1M'); $period = new DatePeriod(DateTime::createFromFormat('m-Y', $begin->format('m-Y')), $interval, $end); foreach ( $period as $dt ) { echo $dt->format( "l Y-m-d H:i:s\n" ); }
based on Ebkuf
Output for 5.6.28, 7.0.20 - 7.2.0
Tuesday 2007-10-30 12:55:41 Friday 2007-11-30 12:55:41 Sunday 2007-12-30 12:55:41
Output for 7.0.6
Wednesday 2007-10-03 19:49:38 Saturday 2007-11-03 19:49:38 Monday 2007-12-03 19:49:38
Output for 7.0.5
Wednesday 2007-10-03 08:09:37 Saturday 2007-11-03 08:09:37 Monday 2007-12-03 08:09:37
Output for 7.0.4
Wednesday 2007-10-10 20:03:26 Saturday 2007-11-10 20:03:26 Monday 2007-12-10 20:03:26
Output for 7.0.3
Thursday 2007-10-18 21:24:12 Sunday 2007-11-18 21:24:12 Tuesday 2007-12-18 21:24:12
Output for 7.0.2
Tuesday 2007-10-23 03:38:00 Friday 2007-11-23 03:38:00 Sunday 2007-12-23 03:38:00
Output for 7.0.1
Wednesday 2007-10-24 06:55:18 Saturday 2007-11-24 06:55:18 Monday 2007-12-24 06:55:18
Output for 7.0.0
Saturday 2007-10-27 08:49:59 Tuesday 2007-11-27 08:49:59 Thursday 2007-12-27 08:49:59
Output for 5.6.21
Tuesday 2007-10-02 14:57:38 Friday 2007-11-02 14:57:38 Sunday 2007-12-02 14:57:38
Output for 5.6.20
Wednesday 2007-10-10 07:10:44 Saturday 2007-11-10 07:10:44 Monday 2007-12-10 07:10:44
Output for 5.6.19
Monday 2007-10-08 04:15:58 Thursday 2007-11-08 04:15:58 Saturday 2007-12-08 04:15:58
Output for 5.6.18
Monday 2007-10-15 13:06:07 Thursday 2007-11-15 13:06:07 Saturday 2007-12-15 13:06:07
Output for 5.6.17
Saturday 2007-10-20 00:41:04 Tuesday 2007-11-20 00:41:04 Thursday 2007-12-20 00:41:04
Output for 5.6.16
Sunday 2007-10-28 09:39:04 Wednesday 2007-11-28 09:39:04 Friday 2007-12-28 09:39:04
Output for 5.6.15
Monday 2007-10-29 10:28:39 Thursday 2007-11-29 10:28:39 Saturday 2007-12-29 10:28:39
Output for 5.6.14
Tuesday 2007-10-02 12:18:56 Friday 2007-11-02 12:18:56 Sunday 2007-12-02 12:18:56
Output for 5.6.13
Monday 2007-10-15 16:50:10 Thursday 2007-11-15 16:50:10 Saturday 2007-12-15 16:50:10
Output for 5.6.12
Saturday 2007-10-20 07:16:53 Tuesday 2007-11-20 07:16:53 Thursday 2007-12-20 07:16:53
Output for 5.6.11
Wednesday 2007-10-24 13:41:31 Saturday 2007-11-24 13:41:31 Monday 2007-12-24 13:41:31
Output for 5.6.10
Thursday 2007-10-25 15:45:08 Sunday 2007-11-25 15:45:08 Tuesday 2007-12-25 15:45:08
Output for 5.6.9
Saturday 2007-10-27 20:53:43 Tuesday 2007-11-27 20:53:43 Thursday 2007-12-27 20:53:43
Output for 5.6.8
Tuesday 2007-10-30 05:42:52 Friday 2007-11-30 05:42:52 Sunday 2007-12-30 05:42:52
Output for 5.5.35
Monday 2007-10-22 23:49:17 Thursday 2007-11-22 23:49:17 Saturday 2007-12-22 23:49:17
Output for 5.5.34
Thursday 2007-10-11 09:22:06 Sunday 2007-11-11 09:22:06 Tuesday 2007-12-11 09:22:06
Output for 5.5.33
Tuesday 2007-10-09 07:08:27 Friday 2007-11-09 07:08:27 Sunday 2007-12-09 07:08:27
Output for 5.5.32
Wednesday 2007-10-17 16:57:06 Saturday 2007-11-17 16:57:06 Monday 2007-12-17 16:57:06
Output for 5.5.31
Sunday 2007-10-21 03:46:27 Wednesday 2007-11-21 03:46:27 Friday 2007-12-21 03:46:27
Output for 5.5.30
Monday 2007-10-01 12:21:41 Thursday 2007-11-01 12:21:41 Saturday 2007-12-01 12:21:41
Output for 5.5.29
Wednesday 2007-10-17 07:08:14 Saturday 2007-11-17 07:08:14 Monday 2007-12-17 07:08:14
Output for 5.5.28
Sunday 2007-10-21 10:32:39 Wednesday 2007-11-21 10:32:39 Friday 2007-12-21 10:32:39
Output for 5.5.27
Monday 2007-10-22 12:15:22 Thursday 2007-11-22 12:15:22 Saturday 2007-12-22 12:15:22
Output for 5.5.26
Friday 2007-10-26 18:26:01 Monday 2007-11-26 18:26:01 Wednesday 2007-12-26 18:26:01
Output for 5.5.25
Monday 2007-10-29 01:49:28 Thursday 2007-11-29 01:49:28 Saturday 2007-12-29 01:49:28
Output for 5.5.24
Wednesday 2007-10-24 08:00:42 Saturday 2007-11-24 08:00:42 Monday 2007-12-24 08:00:42
Output for 5.4.45
Tuesday 2007-10-02 05:07:07 Friday 2007-11-02 05:07:07 Sunday 2007-12-02 05:07:07
Output for 5.4.44
Tuesday 2007-10-02 05:07:09 Friday 2007-11-02 05:07:09 Sunday 2007-12-02 05:07:09
Output for 5.4.43
Tuesday 2007-10-02 05:07:11 Friday 2007-11-02 05:07:11 Sunday 2007-12-02 05:07:11
Output for 5.4.42
Tuesday 2007-10-02 05:07:12 Friday 2007-11-02 05:07:12 Sunday 2007-12-02 05:07:12
Output for 5.4.41
Tuesday 2007-10-02 05:07:13 Friday 2007-11-02 05:07:13 Sunday 2007-12-02 05:07:13
Output for 5.4.40
Tuesday 2007-10-02 05:07:17 Friday 2007-11-02 05:07:17 Sunday 2007-12-02 05:07:17
Output for 5.4.39
Tuesday 2007-10-02 05:07:20 Friday 2007-11-02 05:07:20 Sunday 2007-12-02 05:07:20
Output for 5.4.38
Tuesday 2007-10-02 05:07:21 Friday 2007-11-02 05:07:21 Sunday 2007-12-02 05:07:21
Output for 5.4.37
Tuesday 2007-10-02 05:07:23 Friday 2007-11-02 05:07:23 Sunday 2007-12-02 05:07:23
Output for 5.4.36
Tuesday 2007-10-02 05:07:24 Friday 2007-11-02 05:07:24 Sunday 2007-12-02 05:07:24
Output for 5.4.35
Tuesday 2007-10-02 05:07:26 Friday 2007-11-02 05:07:26 Sunday 2007-12-02 05:07:26
Output for 5.4.34
Tuesday 2007-10-02 05:07:27 Friday 2007-11-02 05:07:27 Sunday 2007-12-02 05:07:27
Output for 5.4.32
Tuesday 2007-10-02 05:07:31 Friday 2007-11-02 05:07:31 Sunday 2007-12-02 05:07:31
Output for 5.3.29, 5.4.31
Tuesday 2007-10-02 05:07:32 Friday 2007-11-02 05:07:32 Sunday 2007-12-02 05:07:32
Output for 5.4.29 - 5.4.30
Tuesday 2007-10-02 05:07:34 Friday 2007-11-02 05:07:34 Sunday 2007-12-02 05:07:34
Output for 5.4.28
Tuesday 2007-10-02 05:07:35 Friday 2007-11-02 05:07:35 Sunday 2007-12-02 05:07:35
Output for 5.4.27
Tuesday 2007-10-02 05:07:36 Friday 2007-11-02 05:07:36 Sunday 2007-12-02 05:07:36
Output for 5.4.26
Tuesday 2007-10-02 05:07:37 Friday 2007-11-02 05:07:37 Sunday 2007-12-02 05:07:37
Output for 5.4.25
Tuesday 2007-10-02 05:07:39 Friday 2007-11-02 05:07:39 Sunday 2007-12-02 05:07:39
Output for 5.4.24
Tuesday 2007-10-02 05:07:40 Friday 2007-11-02 05:07:40 Sunday 2007-12-02 05:07:40
Output for 5.4.23
Tuesday 2007-10-02 05:07:41 Friday 2007-11-02 05:07:41 Sunday 2007-12-02 05:07:41
Output for 5.4.21 - 5.4.22
Tuesday 2007-10-02 05:07:43 Friday 2007-11-02 05:07:43 Sunday 2007-12-02 05:07:43
Output for 5.4.20
Tuesday 2007-10-02 05:07:45 Friday 2007-11-02 05:07:45 Sunday 2007-12-02 05:07:45
Output for 5.4.19
Tuesday 2007-10-02 05:07:46 Friday 2007-11-02 05:07:46 Sunday 2007-12-02 05:07:46
Output for 5.4.18
Tuesday 2007-10-02 05:07:47 Friday 2007-11-02 05:07:47 Sunday 2007-12-02 05:07:47
Output for 5.4.17
Tuesday 2007-10-02 05:07:49 Friday 2007-11-02 05:07:49 Sunday 2007-12-02 05:07:49
Output for 5.4.15 - 5.4.16
Tuesday 2007-10-02 05:07:51 Friday 2007-11-02 05:07:51 Sunday 2007-12-02 05:07:51
Output for 5.3.24 - 5.3.25, 5.4.13 - 5.4.14
Tuesday 2007-10-02 05:07:52 Friday 2007-11-02 05:07:52 Sunday 2007-12-02 05:07:52
Output for 5.3.23, 5.4.12
Tuesday 2007-10-02 05:07:53 Friday 2007-11-02 05:07:53 Sunday 2007-12-02 05:07:53
Output for 5.4.11
Tuesday 2007-10-02 05:07:55 Friday 2007-11-02 05:07:55 Sunday 2007-12-02 05:07:55
Output for 5.3.20, 5.4.10
Tuesday 2007-10-02 05:07:56 Friday 2007-11-02 05:07:56 Sunday 2007-12-02 05:07:56
Output for 5.3.28
Tuesday 2007-10-02 05:07:42 Friday 2007-11-02 05:07:42 Sunday 2007-12-02 05:07:42
Output for 5.3.27
Tuesday 2007-10-02 05:07:48 Friday 2007-11-02 05:07:48 Sunday 2007-12-02 05:07:48
Output for 5.3.26
Tuesday 2007-10-02 05:07:50 Friday 2007-11-02 05:07:50 Sunday 2007-12-02 05:07:50
Output for 5.3.21 - 5.3.22
Tuesday 2007-10-02 05:07:54 Friday 2007-11-02 05:07:54 Sunday 2007-12-02 05:07:54