Run Rector on your code to see what it can do for you:
<?php $arr = [
]; $checkDate = new DateTimeImmutable("2025-03-20 00:00:00"); $foundDate = array_shift($arr); -while ($foundDate < $checkDate && ($foundDate = array_shift($arr)) !== null); -var_dump($foundDate); +var_dump($foundDate);
Applied Rules:
Not a change you expect?
rector.php