3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/New_York'); $start = new DateTime('this year'); $end = new DateTime('+10 years'); $interval = new DateInterval('P1Y'); $adjust = 'fourth thursday of November'; $period = new DatePeriod($start, $interval, $end); foreach($period as $holiday) { $holiday->modify($adjust); echo "Thanksgiving in {$holiday->format('Y')} will be on {$holiday->format('l F jS')}\n"; }

preferences:
37.56 ms | 402 KiB | 5 Q