1--TEST--
2get_locale() icu >= 4.8
3--EXTENSIONS--
4intl
5--SKIPIF--
6<?php if (PHP_INT_SIZE != 8) die('skip 64-bit only'); ?>
7--FILE--
8<?php
9
10/*
11 * Try to specify valid and invalid locale types when getting locale.
12 */
13
14function ut_main()
15{
16    $locales = array(
17        Locale::VALID_LOCALE,
18        Locale::ACTUAL_LOCALE,
19        100,
20        -100,
21        -9999999999999,
22        9999999999999,
23    );
24
25    $coll = ut_coll_create( 'en_US' );
26    $res_str = '';
27
28    foreach( $locales as $locale )
29    {
30        $rc = ut_coll_get_locale( $coll, $locale );
31
32        $res_str .= sprintf(
33            "Locale of type %s is %s\n",
34            dump( $locale ),
35            dump( $rc ) );
36    }
37
38    return $res_str . "\n";
39}
40
41include_once( 'ut_common.inc' );
42ut_run();
43?>
44--EXPECT--
45Locale of type 1 is 'en_US'
46Locale of type 0 is 'root'
47Locale of type 100 is false
48Locale of type -100 is false
49Locale of type -9999999999999 is false
50Locale of type 9999999999999 is false
51