Category
bug · php-src-strict · IntlDateFormatter calendar locale keyword
Problem
Constructing IntlDateFormatter with locale en_US@calendar=<non-gregorian> and IntlDateFormatter::TRADITIONAL must format using that calendar. VM ignores the @calendar keyword and emits Gregorian (or time-only) output.
Repro (format(0), FULL date, NONE time, UTC, TRADITIONAL) |
Zend 8.2+ |
VM (2026-07-24) |
en_US@calendar=hebrew |
Thursday, 23 Tevet 5730 |
Gregorian / time-only (not Hebrew) |
en_US@calendar=islamic |
Thursday, Shawwal 23, 1389 AH |
not Islamic |
en_US@calendar=japanese |
Thursday, January 1, 45 Shōwa |
not Japanese era |
en_US@calendar=buddhist |
Thursday, January 1, 2513 BE |
not Buddhist era |
php-src reference
PHP implementation target
ext/intl/VmIntlDateFormatter.php — honor @calendar= in locale when calendar arg is TRADITIONAL (and when unset defaults follow locale); wire through format path
- Prefer PHP-in-PHP ICU bindings already used elsewhere; no new
runtime/*.c logic
Repro
cat > /tmp/idf_cal.php <<'PHP'
<?php
foreach (['hebrew','islamic','japanese','buddhist'] as $cal) {
$df = new IntlDateFormatter(
\"en_US@calendar=$cal\",
IntlDateFormatter::FULL,
IntlDateFormatter::NONE,
'UTC',
IntlDateFormatter::TRADITIONAL
);
echo \"$cal: \" . $df->format(0) . \"\n\";
}
PHP
./script/docker-exec.sh -- bash -lc 'php /tmp/idf_cal.php; php bin/vm.php /tmp/idf_cal.php'
Host-confirmed (2026-07-24, master b076674e2).
Done when
Category
bug· php-src-strict · IntlDateFormatter calendar locale keywordProblem
Constructing
IntlDateFormatterwith localeen_US@calendar=<non-gregorian>andIntlDateFormatter::TRADITIONALmust format using that calendar. VM ignores the@calendarkeyword and emits Gregorian (or time-only) output.format(0), FULL date, NONE time, UTC, TRADITIONAL)en_US@calendar=hebrewThursday, 23 Tevet 5730en_US@calendar=islamicThursday, Shawwal 23, 1389 AHen_US@calendar=japaneseThursday, January 1, 45 Shōwaen_US@calendar=buddhistThursday, January 1, 2513 BEphp-src reference
ext/intl/dateformat/dateformat_create.cpp— locale calendar keyword +UDAT_TRADITIONALuloc_setKeywordValue("calendar", …)/udat_opencalendarPHP implementation target
ext/intl/VmIntlDateFormatter.php— honor@calendar=in locale whencalendararg isTRADITIONAL(and when unset defaults follow locale); wire through format pathruntime/*.clogicRepro
Host-confirmed (2026-07-24, master
b076674e2).Done when
@calendar=locale above matches Zend date string family (era/month names).phptundertest/compliance/cases/intl/