3v4l.org

run code in 500+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Paris'); $february = new \DateTimeImmutable('2022-02-01T00:00:00'); $march = new \DateTimeImmutable('2022-03-01T00:00:00'); echo $february->format(\DateTimeInterface::ATOM) . PHP_EOL; echo $march->format(\DateTimeInterface::ATOM) . PHP_EOL; var_dump($february->diff($march)->d);

preferences:
22.89 ms | 477 KiB | 4 Q