ID: 48699 Updated by: der...@php.net Reported By: mehdi dot rande at gmail dot com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Linux PHP Version: 5.2.10 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . Previous Comments: ------------------------------------------------------------------------ [2009-06-26 10:48:33] mehdi dot rande at gmail dot com 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48699&edit=1