3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $startUnixTime = strtotime("2013-03-29"); $endUnixTime = strtotime("2013-04-05"); 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(2) { [3]=> array(3) { [29]=> bool(true) [30]=> bool(true) [31]=> bool(true) } [4]=> array(4) { [1]=> bool(true) [2]=> bool(true) [3]=> bool(true) [4]=> bool(true) } } } }