3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Your starting date as DateTime $currentDate = new DateTime(date('Y-m-d')); //Add 1 month $currentDate->add(new DateInterval('P1M')); //Get the first day of the next month as string $firstDayOfNextMonth = strtotime($currentDate->format('Y-m-1')); echo date('m/d/Y', $firstDayOfNextMonth);

preferences:
43.58 ms | 402 KiB | 5 Q