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