1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00
Files
archived-php-src/ext/intl/tests/locale_get_default.phpt
T
2018-10-14 12:07:20 -03:00

47 lines
852 B
PHP

--TEST--
locale_get_default()
--INI--
intl.default_locale=en-US
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
/*
* Try getting the default Locale with different locales
* with Procedural and Object methods.
*/
function ut_main()
{
$res_str = '';
$lang = ut_loc_get_default() ;
$res_str .= "Default locale: $lang";
$res_str .= "\n";
locale_set_default('de-DE');
$lang = ut_loc_get_default() ;
$res_str .= "Default locale: $lang";
$res_str .= "\n";
ini_set('intl.default_locale', 'fr');
$lang = ut_loc_get_default() ;
$res_str .= "Default locale: $lang";
$res_str .= "\n";
ini_restore("intl.default_locale");
return $res_str;
}
include_once( 'ut_common.inc' );
ut_run();
?>
--EXPECT--
Default locale: en-US
Default locale: de-DE
Default locale: fr