3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2010-12-02'); $end = new DateTime('2012-05-06'); $interval = DateInterval::createFromDateString('1 month'); $period = new DatePeriod($start, $interval, $end); foreach ($period as $dt) { $result['year'][] = $dt->format("Y"); $result['month'][] = $dt->format("m"); $result['day'][] = $dt->format("m"); } array_unique($result); print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/TEQGB on line 13 Warning: Array to string conversion in /in/TEQGB on line 13 Warning: Array to string conversion in /in/TEQGB on line 13 Array ( [year] => Array ( [0] => 2010 [1] => 2011 [2] => 2011 [3] => 2011 [4] => 2011 [5] => 2011 [6] => 2011 [7] => 2011 [8] => 2011 [9] => 2011 [10] => 2011 [11] => 2011 [12] => 2011 [13] => 2012 [14] => 2012 [15] => 2012 [16] => 2012 [17] => 2012 ) [month] => Array ( [0] => 12 [1] => 01 [2] => 02 [3] => 03 [4] => 04 [5] => 05 [6] => 06 [7] => 07 [8] => 08 [9] => 09 [10] => 10 [11] => 11 [12] => 12 [13] => 01 [14] => 02 [15] => 03 [16] => 04 [17] => 05 ) [day] => Array ( [0] => 12 [1] => 01 [2] => 02 [3] => 03 [4] => 04 [5] => 05 [6] => 06 [7] => 07 [8] => 08 [9] => 09 [10] => 10 [11] => 11 [12] => 12 [13] => 01 [14] => 02 [15] => 03 [16] => 04 [17] => 05 ) )

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:
65.5 ms | 405 KiB | 8 Q