3v4l.org

run code in 300+ PHP versions simultaneously
<?php $today = new DateTime(); $last_year=(new DateTime())->sub(new DateInterval('P1Y')); $next_year = (new DateTime())->add(new DateInterval('P1Y')); echo $last_year->format('Y').' '.$today->format('Y').' '.$next_year->format('Y');

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
189.66 ms | 3040 KiB | 8 Q