|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-09-04 13:34 UTC] fisharebest at gmail dot com
Description: ------------ --- From manual page: http://www.php.net/function.jddayofweek --- The $mode parameter is an integer (0, 1 or 2) for which predefined constants are also available. Numeric parameters work as per the documentation: 0 = numeric 1 = long name 2 = short name But if the constants CAL_DOW_LONG and CAL_DOW_SHORT are used, the wrong results are returned. CAL_DOW_LONG gives the short name and CAL_DOW_SHORT gives the long name. The bug is present in all versions of PHP from 5.3 through 5.6. Test script: --------------- print_r(jddayofweek(1234567, 1)); // "Saturday" print_r(jddayofweek(1234567, CAL_DOW_LONG)); // "Sat" (WRONG) print_r(CAL_DOW_LONG); // 2 print_r(jddayofweek(1234567, 2)); // "Sat" print_r(CAL_DOW_SHORT); // 1 print_r(jddayofweek(1234567, CAL_DOW_SHORT)); // "Saturday" (WRONG) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 16:00:01 2025 UTC |
I think you need to: 1) reverse the order in the enum {} declaration 2) reverse the two labels in the case statement I have a patch/tests, but can't get the latest code to build so can't test it. I'll try again tonight when I have access to another dev machine.