3v4l.org

run code in 300+ PHP versions simultaneously
<?php $period = new DatePeriod(new DateTime('2010-05-01'), new DateInterval('P1D'), new DateTime('2010-05-10')); foreach ($period as $date) { echo $date->format( "l Y-m-d H:i:s\n" ); } var_dump(iterator_to_array($period));
Output for git.master, git.master_jit, rfc.property-hooks
Saturday 2010-05-01 00:00:00 Sunday 2010-05-02 00:00:00 Monday 2010-05-03 00:00:00 Tuesday 2010-05-04 00:00:00 Wednesday 2010-05-05 00:00:00 Thursday 2010-05-06 00:00:00 Friday 2010-05-07 00:00:00 Saturday 2010-05-08 00:00:00 Sunday 2010-05-09 00:00:00 array(9) { [0]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2010-05-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(DateTime)#8 (3) { ["date"]=> string(26) "2010-05-02 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [2]=> object(DateTime)#9 (3) { ["date"]=> string(26) "2010-05-03 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [3]=> object(DateTime)#10 (3) { ["date"]=> string(26) "2010-05-04 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [4]=> object(DateTime)#11 (3) { ["date"]=> string(26) "2010-05-05 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [5]=> object(DateTime)#12 (3) { ["date"]=> string(26) "2010-05-06 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [6]=> object(DateTime)#13 (3) { ["date"]=> string(26) "2010-05-07 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [7]=> object(DateTime)#14 (3) { ["date"]=> string(26) "2010-05-08 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [8]=> object(DateTime)#15 (3) { ["date"]=> string(26) "2010-05-09 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:
38.93 ms | 405 KiB | 8 Q