3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $startUnixTime = strtotime("2013-03-29"); $endUnixTime = strtotime("2013-05-04"); for($unixTime = $startUnixTime; $unixTime <= $endUnixTime; $unixTime += 60 * 60 * 24){ $year = (int) date("Y", $unixTime); $month = (int) date("m", $unixTime); $day = (int) date("d", $unixTime); $item['days'][$year][$month][$day] = true;//$unixTime >= $resDateFilterFromUnix && $unixTime <= $resDateFilterToUnix; } var_dump($item);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1) { ["days"]=> array(1) { [2013]=> array(3) { [3]=> array(3) { [29]=> bool(true) [30]=> bool(true) [31]=> bool(true) } [4]=> array(30) { [1]=> bool(true) [2]=> bool(true) [3]=> bool(true) [4]=> bool(true) [5]=> bool(true) [6]=> bool(true) [7]=> bool(true) [8]=> bool(true) [9]=> bool(true) [10]=> bool(true) [11]=> bool(true) [12]=> bool(true) [13]=> bool(true) [14]=> bool(true) [15]=> bool(true) [16]=> bool(true) [17]=> bool(true) [18]=> bool(true) [19]=> bool(true) [20]=> bool(true) [21]=> bool(true) [22]=> bool(true) [23]=> bool(true) [24]=> bool(true) [25]=> bool(true) [26]=> bool(true) [27]=> bool(true) [28]=> bool(true) [29]=> bool(true) [30]=> bool(true) } [5]=> array(3) { [1]=> bool(true) [2]=> bool(true) [3]=> bool(true) } } } }