3v4l.org

run code in 300+ PHP versions simultaneously
<?php $previousDay = null; foreach ($days as $day) { if(isset($previousDay)) { // Do the calculations with $day being the current one and prevDay the previous day (night?) } else { // For the first day of the array you have no previous so do normal calculations or smth } $previousDay = $day; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
158.73 ms | 2660 KiB | 8 Q