3v4l.org

run code in 300+ PHP versions simultaneously
<?php $oneMonth = new \DateInterval('P1M'); $startDate = \DateTime::createFromFormat('d H:i:s', '1 00:00:00')->sub(new \DateInterval('P4M')); $period = new \DatePeriod($startDate, $oneMonth, 13); foreach($period as $date){ //$date is an instance of \DateTime. I'm just var_dumping it for illustration var_dump($date); }
Output for git.master, git.master_jit, rfc.property-hooks
object(DateTime)#7 (3) { ["date"]=> string(26) "2013-09-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#9 (3) { ["date"]=> string(26) "2013-10-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#8 (3) { ["date"]=> string(26) "2013-11-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#7 (3) { ["date"]=> string(26) "2013-12-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#9 (3) { ["date"]=> string(26) "2014-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#8 (3) { ["date"]=> string(26) "2014-02-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#7 (3) { ["date"]=> string(26) "2014-03-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#9 (3) { ["date"]=> string(26) "2014-04-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#8 (3) { ["date"]=> string(26) "2014-05-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#7 (3) { ["date"]=> string(26) "2014-06-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#9 (3) { ["date"]=> string(26) "2014-07-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#8 (3) { ["date"]=> string(26) "2014-08-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#7 (3) { ["date"]=> string(26) "2014-09-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#9 (3) { ["date"]=> string(26) "2014-10-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.09 ms | 409 KiB | 8 Q