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('2 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 DYt0B
Output for 5.6.28, 7.0.20 - 7.2.0
Monday 2007-10-01 13:53:49 Saturday 2007-12-01 13:53:49
Output for 7.0.6
Monday 2007-10-01 19:49:38 Saturday 2007-12-01 19:49:38
Output for 7.0.5
Monday 2007-10-01 08:09:37 Saturday 2007-12-01 08:09:37
Output for 7.0.4
Monday 2007-10-01 20:03:33 Saturday 2007-12-01 20:03:33
Output for 7.0.3
Monday 2007-10-01 21:24:20 Saturday 2007-12-01 21:24:20
Output for 7.0.2
Monday 2007-10-01 03:38:07 Saturday 2007-12-01 03:38:07
Output for 7.0.1
Monday 2007-10-01 06:55:25 Saturday 2007-12-01 06:55:25
Output for 7.0.0
Monday 2007-10-01 08:50:05 Saturday 2007-12-01 08:50:05
Output for 5.6.21
Monday 2007-10-01 14:57:38 Saturday 2007-12-01 14:57:38
Output for 5.6.20
Monday 2007-10-01 07:10:43 Saturday 2007-12-01 07:10:43
Output for 5.6.19
Monday 2007-10-01 04:16:04 Saturday 2007-12-01 04:16:04
Output for 5.6.18
Monday 2007-10-01 13:06:13 Saturday 2007-12-01 13:06:13
Output for 5.6.17
Monday 2007-10-01 00:41:10 Saturday 2007-12-01 00:41:10
Output for 5.6.16
Monday 2007-10-01 09:39:08 Saturday 2007-12-01 09:39:08
Output for 5.6.15
Monday 2007-10-01 10:28:44 Saturday 2007-12-01 10:28:44
Output for 5.6.14
Monday 2007-10-01 12:18:55 Saturday 2007-12-01 12:18:55
Output for 5.6.13
Monday 2007-10-01 16:50:09 Saturday 2007-12-01 16:50:09
Output for 5.6.12
Monday 2007-10-01 07:16:53 Saturday 2007-12-01 07:16:53
Output for 5.6.11
Monday 2007-10-01 13:41:30 Saturday 2007-12-01 13:41:30
Output for 5.6.10
Monday 2007-10-01 15:45:08 Saturday 2007-12-01 15:45:08
Output for 5.6.9
Monday 2007-10-01 20:53:43 Saturday 2007-12-01 20:53:43
Output for 5.6.8
Monday 2007-10-01 05:42:52 Saturday 2007-12-01 05:42:52
Output for 5.5.35
Monday 2007-10-01 23:49:15 Saturday 2007-12-01 23:49:15
Output for 5.5.34
Monday 2007-10-01 09:22:06 Saturday 2007-12-01 09:22:06
Output for 5.5.33
Monday 2007-10-01 07:08:35 Saturday 2007-12-01 07:08:35
Output for 5.5.32
Monday 2007-10-01 16:57:15 Saturday 2007-12-01 16:57:15
Output for 5.5.31
Monday 2007-10-01 03:46:35 Saturday 2007-12-01 03:46:35
Output for 5.5.30
Monday 2007-10-01 12:21:41 Saturday 2007-12-01 12:21:41
Output for 5.5.29
Monday 2007-10-01 07:08:13 Saturday 2007-12-01 07:08:13
Output for 5.5.28
Monday 2007-10-01 10:32:38 Saturday 2007-12-01 10:32:38
Output for 5.5.27
Monday 2007-10-01 12:15:22 Saturday 2007-12-01 12:15:22
Output for 5.5.26
Monday 2007-10-01 18:26:00 Saturday 2007-12-01 18:26:00
Output for 5.5.25
Monday 2007-10-01 01:49:27 Saturday 2007-12-01 01:49:27
Output for 5.5.24
Monday 2007-10-01 08:00:41 Saturday 2007-12-01 08:00:41
Output for 5.4.45
Monday 2007-10-01 13:53:55 Saturday 2007-12-01 13:53:55
Output for 5.4.44
Monday 2007-10-01 13:53:56 Saturday 2007-12-01 13:53:56
Output for 5.4.43
Monday 2007-10-01 13:53:58 Saturday 2007-12-01 13:53:58
Output for 5.4.41 - 5.4.42
Monday 2007-10-01 13:53:59 Saturday 2007-12-01 13:53:59
Output for 5.4.40
Monday 2007-10-01 13:54:01 Saturday 2007-12-01 13:54:01
Output for 5.4.39
Monday 2007-10-01 13:54:02 Saturday 2007-12-01 13:54:02
Output for 5.4.38
Monday 2007-10-01 13:54:03 Saturday 2007-12-01 13:54:03
Output for 5.4.37
Monday 2007-10-01 13:54:04 Saturday 2007-12-01 13:54:04
Output for 5.4.36
Monday 2007-10-01 13:54:05 Saturday 2007-12-01 13:54:05
Output for 5.4.35
Monday 2007-10-01 13:54:07 Saturday 2007-12-01 13:54:07
Output for 5.4.34
Monday 2007-10-01 13:54:08 Saturday 2007-12-01 13:54:08
Output for 5.4.32
Monday 2007-10-01 13:54:10 Saturday 2007-12-01 13:54:10
Output for 5.3.29, 5.4.31
Monday 2007-10-01 13:54:11 Saturday 2007-12-01 13:54:11
Output for 5.4.30
Monday 2007-10-01 13:54:12 Saturday 2007-12-01 13:54:12
Output for 5.4.29
Monday 2007-10-01 13:54:13 Saturday 2007-12-01 13:54:13
Output for 5.4.28
Monday 2007-10-01 13:54:14 Saturday 2007-12-01 13:54:14
Output for 5.4.27
Monday 2007-10-01 13:54:15 Saturday 2007-12-01 13:54:15
Output for 5.4.26
Monday 2007-10-01 13:54:16 Saturday 2007-12-01 13:54:16
Output for 5.4.25
Monday 2007-10-01 13:54:17 Saturday 2007-12-01 13:54:17
Output for 5.4.24
Monday 2007-10-01 13:54:18 Saturday 2007-12-01 13:54:18
Output for 5.4.23
Monday 2007-10-01 13:54:19 Saturday 2007-12-01 13:54:19
Output for 5.3.28, 5.4.22
Monday 2007-10-01 13:54:20 Saturday 2007-12-01 13:54:20
Output for 5.4.21
Monday 2007-10-01 13:54:21 Saturday 2007-12-01 13:54:21
Output for 5.4.19 - 5.4.20
Monday 2007-10-01 13:54:22 Saturday 2007-12-01 13:54:22
Output for 5.4.18
Monday 2007-10-01 13:54:23 Saturday 2007-12-01 13:54:23
Output for 5.4.16 - 5.4.17
Monday 2007-10-01 13:54:25 Saturday 2007-12-01 13:54:25
Output for 5.3.25 - 5.3.26, 5.4.15
Monday 2007-10-01 13:54:26 Saturday 2007-12-01 13:54:26
Output for 5.3.24, 5.4.14
Monday 2007-10-01 13:54:27 Saturday 2007-12-01 13:54:27
Output for 5.3.22 - 5.3.23, 5.4.12 - 5.4.13
Monday 2007-10-01 13:54:28 Saturday 2007-12-01 13:54:28
Output for 5.3.20 - 5.3.21, 5.4.11
Monday 2007-10-01 13:54:29 Saturday 2007-12-01 13:54:29
Output for 5.4.10
Monday 2007-10-01 13:54:30 Saturday 2007-12-01 13:54:30
Output for 5.3.27
Monday 2007-10-01 13:54:24 Saturday 2007-12-01 13:54:24