bug74057.phpt 1.0 KB

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #74057: wrong day when using "this week" in strtotime
  3. --FILE--
  4. <?php
  5. echo date("D Y-m-d", strtotime("saturday this week", strtotime("Sun 2017-01-01")))."\n";
  6. echo date("D Y-m-d", strtotime("saturday this week", strtotime("Mon 2017-01-02")))."\n";
  7. echo date("D Y-m-d", strtotime("saturday this week", strtotime("Tue 2017-01-03")))."\n";
  8. echo date("D Y-m-d", strtotime("saturday this week", strtotime("Wed 2017-01-04")))."\n";
  9. echo date("D Y-m-d", strtotime("saturday this week", strtotime("Thu 2017-01-05")))."\n";
  10. echo date("D Y-m-d", strtotime("saturday this week", strtotime("Fri 2017-01-06")))."\n";
  11. echo date("D Y-m-d", strtotime("saturday this week", strtotime("Sat 2017-01-07")))."\n";
  12. echo date("D Y-m-d", strtotime("saturday this week", strtotime("Sun 2017-01-08")))."\n";
  13. echo date("D Y-m-d", strtotime("saturday this week", strtotime("Mon 2017-01-09")))."\n";
  14. ?>
  15. --EXPECT--
  16. Sat 2016-12-31
  17. Sat 2017-01-07
  18. Sat 2017-01-07
  19. Sat 2017-01-07
  20. Sat 2017-01-07
  21. Sat 2017-01-07
  22. Sat 2017-01-07
  23. Sat 2017-01-07
  24. Sat 2017-01-14