3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currentDate = new DateTimeImmutable(); $firstOfTheMonth = new DateTimeImmutable($currentDate->format('Y-m-1')); $oneMonthInterval = new DateInterval('P1M'); var_dump($firstOfTheMonth->sub($oneMonthInterval));

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
153.65 ms | 2611 KiB | 11 Q