xref: /PHP-5.6/ext/intl/tests/bug67052.phpt (revision 941bbf20)
1--TEST--
2Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5<?php
6if (substr(PHP_OS, 0, 3) == 'WIN') {
7  die("skip Valid only on non Windows");
8}
9$l = setlocale(LC_ALL, 'de_DE');
10if($l === false) {
11  die("skip de_DE locale not installed");
12}
13setlocale(LC_ALL, $l);
14?>
15--FILE--
16<?php
17
18function ut_main()
19{
20        setlocale(LC_ALL, 'de_DE.UTF-8');
21        $fmt = new NumberFormatter( 'sl_SI.UTF-8', NumberFormatter::DECIMAL);
22        $num = "1.234.567,891";
23        $res_str =  $fmt->parse($num)."\n";
24        $res_str .=  setlocale(LC_NUMERIC, 0);
25        return $res_str;
26}
27
28include_once( 'ut_common.inc' );
29ut_run();
30
31?>
32--EXPECT--
331234567,891
34de_DE.UTF-8
35
36