1--TEST--
2numfmt_get_locale()
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5<?php if (version_compare(INTL_ICU_VERSION, '51.2') >=  0) die('skip for ICU < 51.2'); ?>
6--FILE--
7<?php
8
9/*
10 * Get locale.
11 */
12
13function ut_main()
14{
15    $locales = array(
16        'en_UK',
17        'en_US@California',
18        'fr_CA',
19    );
20
21    $loc_types = array(
22        Locale::ACTUAL_LOCALE    => 'actual',
23        Locale::VALID_LOCALE     => 'valid',
24    );
25
26    $res_str = '';
27
28    foreach( $locales as $locale )
29    {
30        $fmt = ut_nfmt_create( $locale, NumberFormatter::DECIMAL );
31        $res_str .= "$locale: ";
32        foreach( $loc_types as $loc_type => $loc_type_name )
33            $res_str .= sprintf( " %s=%s",
34            $loc_type_name,
35            dump( ut_nfmt_get_locale( $fmt, $loc_type ) ) );
36        $res_str .= "\n";
37    }
38
39    return $res_str;
40}
41
42include_once( 'ut_common.inc' );
43
44// Run the test
45ut_run();
46?>
47--EXPECT--
48en_UK:  actual='en' valid='en'
49en_US@California:  actual='en' valid='en'
50fr_CA:  actual='fr_CA' valid='fr_CA'
51