|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-06-26 12:22 UTC] derick@php.net
[2009-06-29 12:10 UTC] mehdi dot rande at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
Description: ------------ Since php 5.2.9 modify function behaviour have change, in both case "next $weekday" always go to the next specified weekday ("next weekday" > "today"), but in 5.2.9 and 5.2.10 "+1 $weekday" go to the first encoutered specified weekday including today ("next weekday" >= "today"). The behaviour of older php versions seems more logical to me, '+1' should have the same behaviour than 'next'. Reproduce code: --------------- // Since php 5.2.9 $date = new Datetime("2009-06-01"); $date->modify("+1 ".$date->format("l")); // == ('+1 monday') echo $date->format("Y-m-d")."\n"; $date->modify("next ".$date->format("l")); // == ('next monday') echo $date->format("Y-m-d")."\n"; Expected result: ---------------- 2009-06-08 2009-06-08 Actual result: -------------- 2009-06-01 2009-06-08