3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = strtotime(date('Y-m').'-01'); echo date('Y-m-d',$time); echo '<br>'.$final = date("Y-m-d", strtotime("-1 month", $time)); echo date('m-01-Y 00:00:00',strtotime('this month')) . '<br/>'; echo date('m-t-Y 12:59:59',strtotime('this month')) . '<br/>';

preferences:
36.39 ms | 402 KiB | 5 Q