Category
stdlib · php-src-strict · intl timezone
Problem
IntlTimeZone::createTimeZone($id) for an unrecognized zone does not match Zend/php-src:
- Unknown ID (e.g.
No/Such) — Zend returns an IntlTimeZone whose getID() is Etc/Unknown; VM returns GMT.
- Empty string
'' — Zend → Etc/Unknown; VM → default TZ (UTC on this host).
VmIntlTimeZone::resolveTimezoneId() currently documents “unknown IDs become GMT”, but that does not match Zend 8.2 / current php-src ICU sentinel behavior (TimeZone::getUnknown() → Etc/Unknown).
Verified 2026-07-30 (host Zend 8.2.32 vs bin/vm.php on master):
| Repro |
Zend 8.2 getID() |
VM getID() |
IntlTimeZone::createTimeZone('No/Such') |
Etc/Unknown |
GMT |
IntlTimeZone::createTimeZone('') |
Etc/Unknown |
UTC (default TZ) |
IntlTimeZone::createTimeZone('America/New_York')->getID() |
America/New_York |
America/New_York (ok) |
php-src reference
PHP implementation target
ext/intl/VmIntlTimeZone.php — resolveTimezoneId() / createTimeZone path: map empty + unknown IDs to Etc/Unknown (same object shape as getUnknown()), not GMT / defaultTimezoneGet()
- Align any intl error code/message with php-src for the unknown-ID case
- Prefer PHP-in-PHP; no new
runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php -r '\''
$z = IntlTimeZone::createTimeZone("No/Such");
echo $z->getID(), "\n";
$e = IntlTimeZone::createTimeZone("");
echo $e->getID(), "\n";
'\'' && php bin/vm.php -r '\''
$z = IntlTimeZone::createTimeZone("No/Such");
echo $z->getID(), "\n";
$e = IntlTimeZone::createTimeZone("");
echo $e->getID(), "\n";
'\'''
Done when
Category
stdlib· php-src-strict · intl timezoneProblem
IntlTimeZone::createTimeZone($id)for an unrecognized zone does not match Zend/php-src:No/Such) — Zend returns anIntlTimeZonewhosegetID()isEtc/Unknown; VM returnsGMT.''— Zend →Etc/Unknown; VM → default TZ (UTCon this host).VmIntlTimeZone::resolveTimezoneId()currently documents “unknown IDs become GMT”, but that does not match Zend 8.2 / current php-src ICU sentinel behavior (TimeZone::getUnknown()→Etc/Unknown).Verified 2026-07-30 (host Zend 8.2.32 vs
bin/vm.phponmaster):getID()getID()IntlTimeZone::createTimeZone('No/Such')Etc/UnknownGMTIntlTimeZone::createTimeZone('')Etc/UnknownUTC(default TZ)IntlTimeZone::createTimeZone('America/New_York')->getID()America/New_YorkAmerica/New_York(ok)php-src reference
ext/intl/timezone/timezone_methods.cpp—intltz_create_time_zone/ ICUTimeZone::createTimeZoneTimeZone::getUnknown()→ IDEtc/Unknown(alsoIntlTimeZone::getUnknown(), Stdlib: IntlTimeZone::getUnknown()/getUTC()/createEnumeration()/getIDForWindowsID() missing after #20769 (ext/intl/timezone) #20852)PHP implementation target
ext/intl/VmIntlTimeZone.php—resolveTimezoneId()/createTimeZonepath: map empty + unknown IDs toEtc/Unknown(same object shape asgetUnknown()), notGMT/defaultTimezoneGet()runtime/*.cRepro
Done when
getID() === 'Etc/Unknown'on VM (and JIT/AOT if in scope).phptundertest/compliance/cases/for intl timezone