3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = new DateTime("now"); echo $d->format("F") . PHP_EOL; $d = new DateTime("-1month"); echo $d->format("F") . PHP_EOL; $d = new DateTime("-2months"); echo $d->format("F") . PHP_EOL;
Output for 7.4.0 - 7.4.29, 8.0.1 - 8.0.19, 8.1.0 - 8.1.6
April March February

preferences:
67.6 ms | 409 KiB | 5 Q