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