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