3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set("Europe/London"); $dt = new DateTime("first day of this month"); var_dump($dt); $dt->modify("-5 month"); var_dump($dt); echo date('m/Y', strtotime("-5 month", strtotime("first day of this month")));

preferences:
33.74 ms | 402 KiB | 5 Q