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, ", $ref); echo strftime("this week = %a $F, ", strtotime("this week", $ref)); echo strftime("next week = %a $F\n", strtotime("next week", $ref)); }
Output for 5.6.23 - 5.6.24, 7.0.8 - 7.4.0
Relative to Sat 2016-07-30, this week = Mon 2016-07-25, next week = Mon 2016-08-01 Relative to Sun 2016-07-31, this week = Mon 2016-07-25, next week = Mon 2016-08-01 Relative to Mon 2016-08-01, this week = Mon 2016-08-01, next week = Mon 2016-08-08 Relative to Tue 2016-08-02, this week = Mon 2016-08-01, next week = Mon 2016-08-08
Output for 5.6.0 - 5.6.22, 7.0.0 - 7.0.7
Relative to Sat 2016-07-30, this week = Mon 2016-07-25, next week = Mon 2016-08-01 Relative to Sun 2016-07-31, this week = Mon 2016-08-01, next week = Mon 2016-08-08 Relative to Mon 2016-08-01, this week = Mon 2016-08-01, next week = Mon 2016-08-08 Relative to Tue 2016-08-02, this week = Mon 2016-08-01, next week = Mon 2016-08-08