3v4l.org

run code in 300+ PHP versions simultaneously
<?php $today = new Datetime('today - 1 second'); var_dump($today->format(DATETIME::ATOM)); $expirationDate = $today->add(new DateInterval('P1M')); var_dump($expirationDate->format(DATETIME::ATOM));
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
string(25) "2019-02-09T23:59:59+01:00" string(25) "2019-03-09T23:59:59+01:00"
Output for 7.3.32 - 7.3.33, 8.0.13
string(25) "2019-02-09T23:59:59+00:00" string(25) "2019-03-09T23:59:59+00:00"

preferences:
106.05 ms | 1614 KiB | 4 Q