3v4l.org

run code in 200+ 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\n", strtotime("{$day} next week", $ref)); } echo "\n"; }
Output for 7.0.20, 7.1.5 - 7.4.0
Relative to Sat 2016-07-30 Mon next week = Mon 2016-08-01 Tue next week = Tue 2016-08-02 Wed next week = Wed 2016-08-03 Thu next week = Thu 2016-08-04 Fri next week = Fri 2016-08-05 Sat next week = Sat 2016-08-06 Sun next week = Sun 2016-08-07 Relative to Sun 2016-07-31 Mon next week = Mon 2016-08-01 Tue next week = Tue 2016-08-02 Wed next week = Wed 2016-08-03 Thu next week = Thu 2016-08-04 Fri next week = Fri 2016-08-05 Sat next week = Sat 2016-08-06 Sun next week = Sun 2016-08-07 Relative to Mon 2016-08-01 Mon next week = Mon 2016-08-08 Tue next week = Tue 2016-08-09 Wed next week = Wed 2016-08-10 Thu next week = Thu 2016-08-11 Fri next week = Fri 2016-08-12 Sat next week = Sat 2016-08-13 Sun next week = Sun 2016-08-14 Relative to Tue 2016-08-02 Mon next week = Mon 2016-08-08 Tue next week = Tue 2016-08-09 Wed next week = Wed 2016-08-10 Thu next week = Thu 2016-08-11 Fri next week = Fri 2016-08-12 Sat next week = Sat 2016-08-13 Sun next week = Sun 2016-08-14
Output for 5.6.23 - 5.6.24, 7.0.8 - 7.0.9, 7.1.0
Relative to Sat 2016-07-30 Mon next week = Mon 2016-08-01 Tue next week = Tue 2016-08-02 Wed next week = Wed 2016-08-03 Thu next week = Thu 2016-08-04 Fri next week = Fri 2016-08-05 Sat next week = Sat 2016-08-06 Sun next week = Sun 2016-08-07 Relative to Sun 2016-07-31 Mon next week = Mon 2016-08-01 Tue next week = Mon 2016-08-01 Wed next week = Mon 2016-08-01 Thu next week = Mon 2016-08-01 Fri next week = Mon 2016-08-01 Sat next week = Mon 2016-08-01 Sun next week = Sun 2016-08-07 Relative to Mon 2016-08-01 Mon next week = Mon 2016-08-08 Tue next week = Tue 2016-08-09 Wed next week = Wed 2016-08-10 Thu next week = Thu 2016-08-11 Fri next week = Fri 2016-08-12 Sat next week = Sat 2016-08-13 Sun next week = Sun 2016-08-14 Relative to Tue 2016-08-02 Mon next week = Mon 2016-08-08 Tue next week = Tue 2016-08-09 Wed next week = Wed 2016-08-10 Thu next week = Thu 2016-08-11 Fri next week = Fri 2016-08-12 Sat next week = Sat 2016-08-13 Sun next week = Sun 2016-08-14
Output for 5.6.0 - 5.6.22, 7.0.0 - 7.0.7
Relative to Sat 2016-07-30 Mon next week = Mon 2016-08-01 Tue next week = Tue 2016-08-02 Wed next week = Wed 2016-08-03 Thu next week = Thu 2016-08-04 Fri next week = Fri 2016-08-05 Sat next week = Sat 2016-08-06 Sun next week = Sun 2016-08-07 Relative to Sun 2016-07-31 Mon next week = Mon 2016-08-08 Tue next week = Tue 2016-08-09 Wed next week = Wed 2016-08-10 Thu next week = Thu 2016-08-11 Fri next week = Fri 2016-08-12 Sat next week = Sat 2016-08-13 Sun next week = Sun 2016-08-14 Relative to Mon 2016-08-01 Mon next week = Mon 2016-08-08 Tue next week = Tue 2016-08-09 Wed next week = Wed 2016-08-10 Thu next week = Thu 2016-08-11 Fri next week = Fri 2016-08-12 Sat next week = Sat 2016-08-13 Sun next week = Sun 2016-08-14 Relative to Tue 2016-08-02 Mon next week = Mon 2016-08-08 Tue next week = Tue 2016-08-09 Wed next week = Wed 2016-08-10 Thu next week = Thu 2016-08-11 Fri next week = Fri 2016-08-12 Sat next week = Sat 2016-08-13 Sun next week = Sun 2016-08-14