diff options
author | Ferenc Kovacs <tyrael@php.net> | 2015-01-02 10:15:01 +0100 |
---|---|---|
committer | Ferenc Kovacs <tyrael@php.net> | 2015-01-02 10:15:01 +0100 |
commit | fe46966678db3b82b66b715d37c6254d81dbe568 (patch) | |
tree | 5a4ae82abfb51938d48673c8f1e2b963235bf5af /ext | |
parent | ce6cbb3110254d5dd88e7fdbf198cbe893197042 (diff) | |
parent | 244fc1e05367dc7ebdf2db260c8bc8b106563d26 (diff) | |
download | php-git-fe46966678db3b82b66b715d37c6254d81dbe568.tar.gz |
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
Fixes #67960 - Long/short day names reversed in jddayofweek()
Diffstat (limited to 'ext')
-rw-r--r-- | ext/calendar/calendar.c | 6 | ||||
-rw-r--r-- | ext/calendar/tests/jddayofweek.phpt | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 34b34da371..7ef03f060f 100644 --- a/ext/calendar/calendar.c +++ b/ext/calendar/calendar.c @@ -208,7 +208,7 @@ static struct cal_entry_t cal_conversion_table[CAL_NUM_CALS] = { #define JEWISH_HEB_MONTH_NAME(year) ((monthsPerYear[((year)-1) % 19] == 13)?JewishMonthHebNameLeap:JewishMonthHebName) /* For jddayofweek */ -enum { CAL_DOW_DAYNO, CAL_DOW_SHORT, CAL_DOW_LONG }; +enum { CAL_DOW_DAYNO, CAL_DOW_LONG, CAL_DOW_SHORT }; /* For jdmonthname */ enum { CAL_MONTH_GREGORIAN_SHORT, CAL_MONTH_GREGORIAN_LONG, @@ -696,10 +696,10 @@ PHP_FUNCTION(jddayofweek) daynames = DayNameShort[day]; switch (mode) { - case CAL_DOW_SHORT: + case CAL_DOW_LONG: RETURN_STRING(daynamel, 1); break; - case CAL_DOW_LONG: + case CAL_DOW_SHORT: RETURN_STRING(daynames, 1); break; case CAL_DOW_DAYNO: diff --git a/ext/calendar/tests/jddayofweek.phpt b/ext/calendar/tests/jddayofweek.phpt index c33d59892d..c5647804bb 100644 --- a/ext/calendar/tests/jddayofweek.phpt +++ b/ext/calendar/tests/jddayofweek.phpt @@ -6,7 +6,7 @@ jddayofweek() <?php foreach (array(2440588, 2452162, 2453926, -1000) as $jd) { echo "### JD $jd ###\n"; - for ($mode = 0; $mode <= 2; $mode++) { + foreach (array(CAL_DOW_DAYNO, CAL_DOW_LONG, CAL_DOW_SHORT) as $mode) { echo "--- mode $mode ---\n"; for ($offset = 0; $offset <= 7; $offset++) { echo jddayofweek($jd + $offset, $mode). "\n"; |