3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dates = array( '2015-11-30', '2015-12-01', '2015-12-07', '2015-12-14', '2015-12-21', '2015-12-28', '2015-12-31', '2016-01-01', '2016-01-07', '2016-01-14', '2016-01-31', ); print_r($dates); echo '--------'; foreach ($dates as $date) { $datetime = new DateTime($date); $datetime1 = clone $datetime; $datetime2 = clone $datetime; $modified = clone $datetime; date_modify($modified, '+1 week'); print_r(array( $date, $modified, $datetime->modify('+1 week'), $datetime1->modify('next week'), $datetime2->modify('last day of next week'), )); }

Abusive script

This script was stopped while abusing our resources


preferences:
37.18 ms | 4272 KiB | 5 Q