3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime(); $date->setDate(19987, 1, 2); var_dump($date->format('Y-m-d'));

preferences:
58 ms | 404 KiB | 5 Q