xref: /PHP-8.3/ext/intl/tests/bug14562.phpt (revision 74859783)
1--TEST--
2Bug #14562 NumberFormatter breaks when locale changes
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7
8function ut_main()
9{
10    $res_str = "";
11    $de_locale="de_DE.UTF-8";
12    $fmt = new NumberFormatter("de", NumberFormatter::DECIMAL );
13    $numeric = $fmt->parse("1234,56");
14    $res_str .= "$numeric\n";
15    setlocale(LC_ALL, $de_locale);
16    $fmt = new NumberFormatter("de", NumberFormatter::DECIMAL );
17    $numeric = $fmt->parse("1234,56");
18    setlocale(LC_ALL, "C"); // reset for printing
19    $res_str .= "$numeric\n";
20        return $res_str;
21}
22
23include_once( 'ut_common.inc' );
24ut_run();
25
26?>
27--EXPECT--
281234.56
291234.56
30