3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $startDate = new \DateTime('-1 day'); $finishDate = new \DateTime('+4 day'); $period = new \DatePeriod($startDate, new \DateInterval('P1D'), $finishDate); var_dump($period->start);
Output for 7.2.0
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:48.004339" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:48.003848" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:48.002451" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:48.011518" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:48.006603" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:48.004035" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.20
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-05-20 12:55:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-02 09:00:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-09 21:05:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-17 22:26:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-22 04:40:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-23 07:50:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-26 09:43:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-05-01 15:52:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-09 08:02:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-07 05:13:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-14 14:07:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-19 01:40:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-27 10:33:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-28 11:22:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-13 17:04:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-14 17:43:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-19 08:12:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-23 14:37:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-24 16:43:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-26 21:51:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-29 06:39:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-05-22 01:22:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-10 10:15:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-08 08:11:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-16 18:03:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-20 04:48:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-03-31 13:15:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-16 08:01:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-20 11:30:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-21 13:10:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-25 19:22:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-04-28 02:47:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
object(DateTime)#7 (3) { ["date"]=> string(26) "2016-05-23 09:13:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.45
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.44
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.43
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.41 - 5.4.42
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.39 - 5.4.40
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.37 - 5.4.38
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.34 - 5.4.36
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.31 - 5.4.32
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30
object(DateTime)#7 (3) { ["date"]=> string(26) "2015-12-21 21:34:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.27 - 5.4.29
object(DateTime)#7 (3) { ["date"]=> string(19) "2015-12-21 21:34:58" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.24 - 5.4.26
object(DateTime)#7 (3) { ["date"]=> string(19) "2015-12-21 21:34:59" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.28, 5.4.20 - 5.4.23
object(DateTime)#7 (3) { ["date"]=> string(19) "2015-12-21 21:35:00" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.27, 5.4.18 - 5.4.19
object(DateTime)#7 (3) { ["date"]=> string(19) "2015-12-21 21:35:01" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.17
object(DateTime)#7 (3) { ["date"]=> string(19) "2015-12-21 21:35:02" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.21 - 5.3.26, 5.4.11 - 5.4.16
Notice: Undefined property: DatePeriod::$start in /in/5RhPq on line 7 NULL
Output for 5.3.29
object(DateTime)#7 (3) { ["date"]=> string(19) "2015-12-21 21:34:57" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }