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