Category
stdlib
Problem
There is no ext/intl in this repo. Zend exposes IntlDateFormatter (datefmt_create, format, locale/timezone) via ICU. Web and CLI code using localized date formatting fails with missing class/function.
php-src reference
Repro (failure today)
<?php
$fmt = IntlDateFormatter::create(
'en_US',
IntlDateFormatter::SHORT,
IntlDateFormatter::SHORT,
null,
IntlDateFormatter::GREGORIAN,
'yyyy-MM-dd'
);
echo $fmt->format(new DateTime('2020-01-15 12:00:00'));
docker info >/dev/null
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php repro.php
php bin/vm.php repro.php
'
| Check |
Zend PHP 8.2 (icu) |
bin/vm.php (today) |
class_exists('IntlDateFormatter') |
true |
false |
format(DateTime) |
localized string (e.g. 1/15/20) |
fatal / missing class |
Scope (this repo)
| Layer |
Path |
Notes |
| Module |
ext/intl/Module.php (new) |
Register class + IntlDateFormatter::* int constants |
| Class |
ext/intl/IntlDateFormatter.php |
PHP-first; ICU via thin FFI to ucal_* only if unavoidable — document in PR |
| Wire |
lib/VM/BuiltinClasses.php, loader next to ext/standard/Module.php |
|
| DateTime |
Depends on #5120 DateTime OOP surface |
|
| Tests |
test/compliance/cases/stdlib/intl_dateformatter_short.phpt |
|
| Matrix |
script/capability-matrix.php row |
|
Out of scope: NumberFormatter (#5154), Normalizer (#5153), intl_get_error_* (#5156).
Done when
Links
#5154, #5156, #5120, #1492
Category
stdlibProblem
There is no
ext/intlin this repo. Zend exposesIntlDateFormatter(datefmt_create,format, locale/timezone) via ICU. Web and CLI code using localized date formatting fails with missing class/function.php-src reference
ext/intl/dateformat/dateformat_class.c—IntlDateFormatterclassext/intl/dateformat/dateformat_format.c—datefmt_formatext/intl/dateformat/dateformat_create.c—datefmt_createext/intl/php_intl.h— module initext/intl/dateformat/dateformat.stub.php— constantsSHORT,LONG, …Repro (failure today)
bin/vm.php(today)class_exists('IntlDateFormatter')truefalseformat(DateTime)1/15/20)Scope (this repo)
ext/intl/Module.php(new)IntlDateFormatter::*int constantsext/intl/IntlDateFormatter.phpucal_*only if unavoidable — document in PRlib/VM/BuiltinClasses.php, loader next toext/standard/Module.phpDateTimeOOP surfacetest/compliance/cases/stdlib/intl_dateformatter_short.phptscript/capability-matrix.phprowOut of scope:
NumberFormatter(#5154),Normalizer(#5153),intl_get_error_*(#5156).Done when
IntlDateFormatter::create('en_US', SHORT, SHORT, …)returns object on VMformat(new DateTime('2020-01-15'))matches Zend output for en_US SHORT/SHORT (normalize whitespace in test)class_exists('IntlDateFormatter')true when ext enabled./script/ci-fast.sh --filter intl_dateformattergreenscript/capability-matrix.phpLinks
#5154, #5156, #5120, #1492