3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lastDate = new DateTime(); $lastDate->sub(new DateInterval("P1M")); $generateToThisDate = new DateTime(); $generateToThisDate->add(new DateInterval("P20M")); while ($lastDate < $generateToThisDate) { $lastDate->add(new DateInterval("P1M")); echo $lastDate->format('Y-m-d') . " - " . $lastDate->format('Y-m-t') . "\n"; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
156.67 ms | 2925 KiB | 10 Q