3v4l.org

run code in 300+ PHP versions simultaneously
<?php $firstDayNextMonth = date('Y-m-01', strtotime('+ first day of this month -2 month', time())); echo $firstDayNextMonth;

preferences:
32.68 ms | 402 KiB | 5 Q