3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo date('Y-m-d', strtotime('last day of this month previous year')) . PHP_EOL; echo (new DateTime('last day of this month previous year'))->format('Y-m-d');

preferences:
24.82 ms | 405 KiB | 5 Q