3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = array( "2016-02-01", "2016-03-01", "2016-04-01", "2016-05-01", "2016-06-01", "2016-07-01", "2016-09-01", "2016-11-01", "2016-12-01", "2017-01-01", "2017-12-01" ); $datez = array(); $date = array(); $datez[] = 0; for($i = 1; $i < count($dates) - 1; $i++){ $start_date = $dates[$i-1]; $end_Date = $dates[$i]; $date1 = new DateTime($start_date); $date2 = new DateTime($end_Date); $interval = $date1->diff($date2); $date[] = $interval->days; $datez[] = array_sum($date); } print_r($date); print_r($datez);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 29 [1] => 31 [2] => 30 [3] => 31 [4] => 30 [5] => 62 [6] => 61 [7] => 30 [8] => 31 ) Array ( [0] => 0 [1] => 29 [2] => 60 [3] => 90 [4] => 121 [5] => 151 [6] => 213 [7] => 274 [8] => 304 [9] => 335 )

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:
34.1 ms | 406 KiB | 5 Q