php-src/ext/intl/tests/bug58756_MessageFormatter_variant2.phpt
Nikita Popov 7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

41 lines
958 B
PHP

--TEST--
Bug #58756: w.r.t MessageFormatter
--EXTENSIONS--
intl
--SKIPIF--
<?php
if (version_compare(INTL_ICU_VERSION, '51.2') < 0) {
die('skip for ICU >= 51.2');
}
if (str_contains(PHP_OS, 'FreeBSD')) {
die('xfail Fails on FreeBSD for unknown reason');
}
?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
//ini_set("intl.default_locale", "nl");
$time = 1247013673;
ini_set('date.timezone', 'America/New_York');
$msgf = new MessageFormatter('en_US', '{0,date,full} {0,time,h:m:s a V}');
echo "date: " . date('l, F j, Y g:i:s A T', $time) . "\n";
echo "msgf: " . $msgf->format(array($time)) . "\n";
//NOT FIXED:
/*$msgf = new MessageFormatter('en_US',
'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}');
echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
$msgf->format(array($time, 'time')), "\n";
*/
?>
--EXPECT--
date: Tuesday, July 7, 2009 8:41:13 PM EDT
msgf: Tuesday, July 7, 2009 8:41:13 PM usnyc