3v4l.org

run code in 300+ PHP versions simultaneously
<?php $F = strftime("%F") ? "%F" : "%Y-%m-%d"; foreach (array("Sat 2016-07-30", "Sun 2016-07-31", "Mon 2016-08-01", "Tue 2016-08-02") as $ref) { $ref = strtotime($ref); echo strftime("Relative to %a $F\n", $ref); foreach (array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") as $day) { echo strftime("{$day} next week = %a $F\t", strtotime("{$day} next week", $ref)); echo strftime("next week {$day} = %a $F\n", strtotime("next week {$day}", $ref)); } echo "\n"; }

preferences:
60.92 ms | 402 KiB | 5 Q