3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $this_monday = new DateTime('Monday this week'); $next_monday = new DateTime('Monday next week'); $interval = new DateInterval('P1D'); $datePeriod = new DatePeriod($this_monday, $interval, $next_monday); foreach($datePeriod as $day) { printf("%s | %s<br>\n", $day->format('l'), $day->format('d-m-Y')); }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.28, 5.6.28, 7.0.14 - 7.1.0
Monday | 12-05-2014<br> Tuesday | 13-05-2014<br> Wednesday | 14-05-2014<br> Thursday | 15-05-2014<br> Friday | 16-05-2014<br> Saturday | 17-05-2014<br> Sunday | 18-05-2014<br>
Output for 5.6.21, 7.0.6
Monday | 02-05-2016<br> Tuesday | 03-05-2016<br> Wednesday | 04-05-2016<br> Thursday | 05-05-2016<br> Friday | 06-05-2016<br> Saturday | 07-05-2016<br> Sunday | 08-05-2016<br>
Output for 5.5.30, 5.6.14 - 5.6.16, hhvm-3.10.0, 7.0.5
Monday | 28-03-2016<br> Tuesday | 29-03-2016<br> Wednesday | 30-03-2016<br> Thursday | 31-03-2016<br> Friday | 01-04-2016<br> Saturday | 02-04-2016<br> Sunday | 03-04-2016<br>
Output for 5.5.33, 5.6.19, hhvm-3.12.0, 7.0.4
Monday | 07-03-2016<br> Tuesday | 08-03-2016<br> Wednesday | 09-03-2016<br> Thursday | 10-03-2016<br> Friday | 11-03-2016<br> Saturday | 12-03-2016<br> Sunday | 13-03-2016<br>
Output for 5.5.32, 5.6.17 - 5.6.18, 7.0.3
Monday | 14-03-2016<br> Tuesday | 15-03-2016<br> Wednesday | 16-03-2016<br> Thursday | 17-03-2016<br> Friday | 18-03-2016<br> Saturday | 19-03-2016<br> Sunday | 20-03-2016<br>
Output for 5.5.31, 7.0.0 - 7.0.2
Monday | 21-03-2016<br> Tuesday | 22-03-2016<br> Wednesday | 23-03-2016<br> Thursday | 24-03-2016<br> Friday | 25-03-2016<br> Saturday | 26-03-2016<br> Sunday | 27-03-2016<br>
Output for 5.6.20
Monday | 04-04-2016<br> Tuesday | 05-04-2016<br> Wednesday | 06-04-2016<br> Thursday | 07-04-2016<br> Friday | 08-04-2016<br> Saturday | 09-04-2016<br> Sunday | 10-04-2016<br>
Output for 5.5.29, 5.5.34, 5.6.13
Monday | 11-04-2016<br> Tuesday | 12-04-2016<br> Wednesday | 13-04-2016<br> Thursday | 14-04-2016<br> Friday | 15-04-2016<br> Saturday | 16-04-2016<br> Sunday | 17-04-2016<br>
Output for 5.5.27 - 5.5.28, 5.6.11 - 5.6.12
Monday | 18-04-2016<br> Tuesday | 19-04-2016<br> Wednesday | 20-04-2016<br> Thursday | 21-04-2016<br> Friday | 22-04-2016<br> Saturday | 23-04-2016<br> Sunday | 24-04-2016<br>
Output for 5.5.25 - 5.5.26, 5.6.8 - 5.6.10
Monday | 25-04-2016<br> Tuesday | 26-04-2016<br> Wednesday | 27-04-2016<br> Thursday | 28-04-2016<br> Friday | 29-04-2016<br> Saturday | 30-04-2016<br> Sunday | 01-05-2016<br>
Output for 5.5.24, 5.5.35 - 5.6.7
Monday | 23-05-2016<br> Tuesday | 24-05-2016<br> Wednesday | 25-05-2016<br> Thursday | 26-05-2016<br> Friday | 27-05-2016<br> Saturday | 28-05-2016<br> Sunday | 29-05-2016<br>
Output for 5.4.44 - 5.4.45
Monday | 07-09-2015<br> Tuesday | 08-09-2015<br> Wednesday | 09-09-2015<br> Thursday | 10-09-2015<br> Friday | 11-09-2015<br> Saturday | 12-09-2015<br> Sunday | 13-09-2015<br>
Output for 5.4.43
Monday | 13-07-2015<br> Tuesday | 14-07-2015<br> Wednesday | 15-07-2015<br> Thursday | 16-07-2015<br> Friday | 17-07-2015<br> Saturday | 18-07-2015<br> Sunday | 19-07-2015<br>
Output for 5.4.42
Monday | 06-07-2015<br> Tuesday | 07-07-2015<br> Wednesday | 08-07-2015<br> Thursday | 09-07-2015<br> Friday | 10-07-2015<br> Saturday | 11-07-2015<br> Sunday | 12-07-2015<br>
Output for 5.4.41
Monday | 25-05-2015<br> Tuesday | 26-05-2015<br> Wednesday | 27-05-2015<br> Thursday | 28-05-2015<br> Friday | 29-05-2015<br> Saturday | 30-05-2015<br> Sunday | 31-05-2015<br>
Output for 5.4.39 - 5.4.40
Monday | 27-04-2015<br> Tuesday | 28-04-2015<br> Wednesday | 29-04-2015<br> Thursday | 30-04-2015<br> Friday | 01-05-2015<br> Saturday | 02-05-2015<br> Sunday | 03-05-2015<br>
Output for 5.4.38
Monday | 23-02-2015<br> Tuesday | 24-02-2015<br> Wednesday | 25-02-2015<br> Thursday | 26-02-2015<br> Friday | 27-02-2015<br> Saturday | 28-02-2015<br> Sunday | 01-03-2015<br>
Output for 5.4.36 - 5.4.37
Monday | 02-02-2015<br> Tuesday | 03-02-2015<br> Wednesday | 04-02-2015<br> Thursday | 05-02-2015<br> Friday | 06-02-2015<br> Saturday | 07-02-2015<br> Sunday | 08-02-2015<br>
Output for 5.4.34 - 5.4.35
Monday | 10-11-2014<br> Tuesday | 11-11-2014<br> Wednesday | 12-11-2014<br> Thursday | 13-11-2014<br> Friday | 14-11-2014<br> Saturday | 15-11-2014<br> Sunday | 16-11-2014<br>
Output for 5.3.29, 5.4.29 - 5.4.32
Monday | 01-09-2014<br> Tuesday | 02-09-2014<br> Wednesday | 03-09-2014<br> Thursday | 04-09-2014<br> Friday | 05-09-2014<br> Saturday | 06-09-2014<br> Sunday | 07-09-2014<br>
Output for 5.2.0 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/kAgL2 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/kAgL2 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/kAgL2 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/kAgL2 on line 3