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