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} this week = %a $F\t", strtotime("{$day} this week", $ref)); echo strftime("this week {$day} = %a $F\n", strtotime("this week {$day}", $ref)); } echo "\n"; }
Output for 7.0.17 - 7.0.33, 7.1.3 - 7.4.1
Relative to Sat 2016-07-30 Mon this week = Mon 2016-07-25 this week Mon = Mon 2016-07-25 Tue this week = Tue 2016-07-26 this week Tue = Tue 2016-07-26 Wed this week = Wed 2016-07-27 this week Wed = Wed 2016-07-27 Thu this week = Thu 2016-07-28 this week Thu = Thu 2016-07-28 Fri this week = Fri 2016-07-29 this week Fri = Fri 2016-07-29 Sat this week = Sat 2016-07-30 this week Sat = Sat 2016-07-30 Sun this week = Sun 2016-07-31 this week Sun = Sun 2016-07-31 Relative to Sun 2016-07-31 Mon this week = Mon 2016-07-25 this week Mon = Mon 2016-07-25 Tue this week = Tue 2016-07-26 this week Tue = Tue 2016-07-26 Wed this week = Wed 2016-07-27 this week Wed = Wed 2016-07-27 Thu this week = Thu 2016-07-28 this week Thu = Thu 2016-07-28 Fri this week = Fri 2016-07-29 this week Fri = Fri 2016-07-29 Sat this week = Sat 2016-07-30 this week Sat = Sat 2016-07-30 Sun this week = Sun 2016-07-31 this week Sun = Sun 2016-07-31 Relative to Mon 2016-08-01 Mon this week = Mon 2016-08-01 this week Mon = Mon 2016-08-01 Tue this week = Tue 2016-08-02 this week Tue = Tue 2016-08-02 Wed this week = Wed 2016-08-03 this week Wed = Wed 2016-08-03 Thu this week = Thu 2016-08-04 this week Thu = Thu 2016-08-04 Fri this week = Fri 2016-08-05 this week Fri = Fri 2016-08-05 Sat this week = Sat 2016-08-06 this week Sat = Sat 2016-08-06 Sun this week = Sun 2016-08-07 this week Sun = Sun 2016-08-07 Relative to Tue 2016-08-02 Mon this week = Mon 2016-08-01 this week Mon = Mon 2016-08-01 Tue this week = Tue 2016-08-02 this week Tue = Tue 2016-08-02 Wed this week = Wed 2016-08-03 this week Wed = Wed 2016-08-03 Thu this week = Thu 2016-08-04 this week Thu = Thu 2016-08-04 Fri this week = Fri 2016-08-05 this week Fri = Fri 2016-08-05 Sat this week = Sat 2016-08-06 this week Sat = Sat 2016-08-06 Sun this week = Sun 2016-08-07 this week Sun = Sun 2016-08-07
Output for 5.6.23 - 5.6.40, 7.0.8 - 7.0.16, 7.1.0 - 7.1.2
Relative to Sat 2016-07-30 Mon this week = Mon 2016-07-25 this week Mon = Mon 2016-07-25 Tue this week = Tue 2016-07-26 this week Tue = Tue 2016-07-26 Wed this week = Wed 2016-07-27 this week Wed = Wed 2016-07-27 Thu this week = Thu 2016-07-28 this week Thu = Thu 2016-07-28 Fri this week = Fri 2016-07-29 this week Fri = Fri 2016-07-29 Sat this week = Sat 2016-07-30 this week Sat = Sat 2016-07-30 Sun this week = Sun 2016-07-31 this week Sun = Sun 2016-07-31 Relative to Sun 2016-07-31 Mon this week = Mon 2016-07-25 this week Mon = Mon 2016-07-25 Tue this week = Mon 2016-07-25 this week Tue = Mon 2016-07-25 Wed this week = Mon 2016-07-25 this week Wed = Mon 2016-07-25 Thu this week = Mon 2016-07-25 this week Thu = Mon 2016-07-25 Fri this week = Mon 2016-07-25 this week Fri = Mon 2016-07-25 Sat this week = Mon 2016-07-25 this week Sat = Mon 2016-07-25 Sun this week = Sun 2016-07-31 this week Sun = Sun 2016-07-31 Relative to Mon 2016-08-01 Mon this week = Mon 2016-08-01 this week Mon = Mon 2016-08-01 Tue this week = Tue 2016-08-02 this week Tue = Tue 2016-08-02 Wed this week = Wed 2016-08-03 this week Wed = Wed 2016-08-03 Thu this week = Thu 2016-08-04 this week Thu = Thu 2016-08-04 Fri this week = Fri 2016-08-05 this week Fri = Fri 2016-08-05 Sat this week = Sat 2016-08-06 this week Sat = Sat 2016-08-06 Sun this week = Sun 2016-08-07 this week Sun = Sun 2016-08-07 Relative to Tue 2016-08-02 Mon this week = Mon 2016-08-01 this week Mon = Mon 2016-08-01 Tue this week = Tue 2016-08-02 this week Tue = Tue 2016-08-02 Wed this week = Wed 2016-08-03 this week Wed = Wed 2016-08-03 Thu this week = Thu 2016-08-04 this week Thu = Thu 2016-08-04 Fri this week = Fri 2016-08-05 this week Fri = Fri 2016-08-05 Sat this week = Sat 2016-08-06 this week Sat = Sat 2016-08-06 Sun this week = Sun 2016-08-07 this week Sun = Sun 2016-08-07
Output for 5.6.0 - 5.6.22, 7.0.0 - 7.0.7
Relative to Sat 2016-07-30 Mon this week = Mon 2016-07-25 this week Mon = Mon 2016-07-25 Tue this week = Tue 2016-07-26 this week Tue = Tue 2016-07-26 Wed this week = Wed 2016-07-27 this week Wed = Wed 2016-07-27 Thu this week = Thu 2016-07-28 this week Thu = Thu 2016-07-28 Fri this week = Fri 2016-07-29 this week Fri = Fri 2016-07-29 Sat this week = Sat 2016-07-30 this week Sat = Sat 2016-07-30 Sun this week = Sun 2016-07-31 this week Sun = Sun 2016-07-31 Relative to Sun 2016-07-31 Mon this week = Mon 2016-08-01 this week Mon = Mon 2016-08-01 Tue this week = Tue 2016-08-02 this week Tue = Tue 2016-08-02 Wed this week = Wed 2016-08-03 this week Wed = Wed 2016-08-03 Thu this week = Thu 2016-08-04 this week Thu = Thu 2016-08-04 Fri this week = Fri 2016-08-05 this week Fri = Fri 2016-08-05 Sat this week = Sat 2016-08-06 this week Sat = Sat 2016-08-06 Sun this week = Sun 2016-08-07 this week Sun = Sun 2016-08-07 Relative to Mon 2016-08-01 Mon this week = Mon 2016-08-01 this week Mon = Mon 2016-08-01 Tue this week = Tue 2016-08-02 this week Tue = Tue 2016-08-02 Wed this week = Wed 2016-08-03 this week Wed = Wed 2016-08-03 Thu this week = Thu 2016-08-04 this week Thu = Thu 2016-08-04 Fri this week = Fri 2016-08-05 this week Fri = Fri 2016-08-05 Sat this week = Sat 2016-08-06 this week Sat = Sat 2016-08-06 Sun this week = Sun 2016-08-07 this week Sun = Sun 2016-08-07 Relative to Tue 2016-08-02 Mon this week = Mon 2016-08-01 this week Mon = Mon 2016-08-01 Tue this week = Tue 2016-08-02 this week Tue = Tue 2016-08-02 Wed this week = Wed 2016-08-03 this week Wed = Wed 2016-08-03 Thu this week = Thu 2016-08-04 this week Thu = Thu 2016-08-04 Fri this week = Fri 2016-08-05 this week Fri = Fri 2016-08-05 Sat this week = Sat 2016-08-06 this week Sat = Sat 2016-08-06 Sun this week = Sun 2016-08-07 this week Sun = Sun 2016-08-07