|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-12-01 14:40 UTC] leo dot sjoberg at gmail dot com
[2020-01-20 17:18 UTC] girgias@php.net
-Assigned To:
+Assigned To: derick
[2020-01-20 17:28 UTC] girgias@php.net
[2022-07-22 16:39 UTC] derick@php.net
-Status: Assigned
+Status: Not a bug
[2022-07-22 16:39 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
Description: ------------ Today is 2019-05-29, wednesday. In any php 7.* interpreter I write echo date('Y-m-d', strtotime('last wednesday')); and get last week's day (2019-05-22) echo date('Y-m-d', strtotime('last wednesday + 1 day')); shows correct date too (2019-05-23) But echo date('Y-m-d', strtotime('last wednesday + 7 day')); gives result like 'last wednesday' was today (2019-06-05) Live example on Ideone: https://ideone.com/1YzDpS php 5.6 doesn't have this bug! Test script: --------------- $day = date("l"); echo date("Y-m-d", strtotime("last $day")) . "\n"; echo date("Y-m-d", strtotime("last $day + 1 day")) . "\n"; echo date("Y-m-d", strtotime("last $day + 6 day")) . "\n"; echo date("Y-m-d", strtotime("last $day + 7 day")) . "\n"; Expected result: ---------------- 2019-05-21 2019-05-22 2019-05-27 2019-05-28 Actual result: -------------- 2019-05-21 2019-05-22 2019-05-27 2019-06-04