3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $start = new DateTime(); $interval = new DateInterval('P2W'); $period = new DatePeriod( $start, $interval, 1, DatePeriod::EXCLUDE_START_DATE ); foreach ($period as $nextDateTime) { echo $nextDateTime->format('Y-m-d H:i:s'), PHP_EOL; }
based on ZBL4S
Output for 5.6.28, 7.0.20 - 7.2.0
2015-10-30 11:28:55
Output for 7.0.6
2016-05-17 12:13:27
Output for 7.0.5
2016-04-17 00:57:13
Output for 7.0.4
2016-03-24 11:40:07
Output for 7.0.3
2016-04-01 12:23:48
Output for 7.0.2
2016-04-05 18:21:31
Output for 7.0.1
2016-04-06 22:44:45
Output for 7.0.0
2016-04-10 00:14:14
Output for 5.6.21
2016-05-16 07:26:43
Output for 5.6.20
2016-04-23 23:48:16
Output for 5.6.19
2016-03-21 19:42:19
Output for 5.6.18
2016-03-29 04:16:07
Output for 5.6.17
2016-04-02 16:32:34
Output for 5.6.16
2016-04-11 02:12:00
Output for 5.6.15
2016-04-12 03:07:37
Output for 5.6.14
2016-04-16 05:18:59
Output for 5.6.13
2016-04-29 09:18:05
Output for 5.6.12
2016-05-03 23:15:26
Output for 5.6.11
2016-05-07 06:11:33
Output for 5.6.10
2016-05-09 07:58:09
Output for 5.6.9
2016-05-11 13:01:56
Output for 5.6.8
2016-05-13 21:12:19
Output for 5.5.35
2016-06-05 11:13:07
Output for 5.5.34
2016-04-25 02:09:38
Output for 5.5.33
2016-03-22 22:40:17
Output for 5.5.32
2016-03-31 06:20:04
Output for 5.5.31
2016-04-03 19:15:53
Output for 5.5.30
2016-04-15 05:02:12
Output for 5.5.29
2016-04-30 23:26:05
Output for 5.5.28
2016-05-05 02:35:26
Output for 5.5.27
2016-05-06 04:52:25
Output for 5.5.26
2016-05-10 10:30:12
Output for 5.5.25
2016-05-12 16:56:55
Output for 5.5.24
2016-06-07 00:04:25
Output for 5.4.44 - 5.4.45
2015-10-30 11:29:06
Output for 5.4.37 - 5.4.43
2015-10-30 11:29:07
Output for 5.4.30 - 5.4.36
2015-10-30 11:29:08
Output for 5.4.23 - 5.4.29
2015-10-30 11:29:09
Output for 5.4.16 - 5.4.22
2015-10-30 11:29:10
Output for 5.4.9 - 5.4.15
2015-10-30 11:29:11
Output for 5.4.8
2015-10-30 11:29:12
Output for 5.4.7
2015-11-10 02:01:14
Output for 5.4.6
2015-11-10 03:29:42
Output for 5.4.5
2015-11-10 04:59:57
Output for 5.4.4
2015-11-10 06:37:11
Output for 5.4.3
2015-11-10 08:18:38
Output for 5.4.2
2015-11-10 10:03:27
Output for 5.3.29
2015-11-14 06:01:23
Output for 5.3.28
2015-11-14 08:10:10
Output for 5.3.27
2015-11-16 07:11:36
Output for 5.3.26
2015-11-16 09:12:49
Output for 5.3.25
2015-11-16 10:43:02
Output for 5.3.24
2015-11-16 11:54:32
Output for 5.3.23
2015-11-16 13:30:50
Output for 5.3.22
2015-11-16 15:01:57
Output for 5.3.21
2015-11-16 16:02:07
Output for 5.3.20
2015-11-16 17:02:28
Output for 5.3.19
2015-11-16 18:27:45
Output for 5.3.18
2015-11-16 18:34:22