3v4l.org

run code in 300+ PHP versions simultaneously
<?php // from 2015 through all of 2018, expect 35,064 elements in the deepest level. $start = 2018; $end = 2018; $years = []; foreach (range($start, $end) as $y) { $months = []; for ($m = 1; $m <= 12; ++$m) { $lastDayOfMonth = date('t', strtotime("$y-$m-01")); $days = []; for ($d = 1; $d <= $lastDayOfMonth; ++$d) { $days[] = range(0, 23); } $months[] = $days; } $years[] = $months; } var_export($years);

Abusive script

This script was stopped while abusing our resources


preferences:
23.32 ms | 407 KiB | 5 Q