summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/bug65769.phpt
blob: e30d0f41ba7a7fcbb6ee373ec251a4a2dc441ec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
--TEST--
Bug #65769 localeconv() broken in TS builds
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
    die('skip Windows only');
}
if (PHP_WINDOWS_VERSION_MAJOR < 10) {
	die("skip for Windows 10 and above");
}
?>
--FILE--
<?php

$locales = array('sve', 'french', 'us', 'ru', 'czech', 'serbian');

foreach ($locales as $locale) {
	$locale = setlocale(LC_ALL, $locale);
	$lconv = localeconv();
	var_dump(
		$locale,
		$lconv['decimal_point'],
		$lconv['thousands_sep'],
		$lconv['int_curr_symbol'],
		$lconv['currency_symbol'],
		$lconv['mon_decimal_point'],
		$lconv['mon_thousands_sep']
	);
	if ($locale === 'Swedish_Sweden.1252') {
		var_dump(in_array($lconv['mon_thousands_sep'], [',', ' ']));
	}
	echo '++++++++++++++++++++++', "\n";
}

?>
+++DONE+++
--EXPECTF--
string(19) "Swedish_Sweden.1252"
string(1) ","
string(1) " "
string(3) "SEK"
string(2) "kr"
string(1) ","
string(1) "%c"
bool(true)
++++++++++++++++++++++
string(18) "French_France.1252"
string(1) ","
string(1) " "
string(3) "EUR"
string(1) "€"
string(1) ","
string(1) " "
++++++++++++++++++++++
string(26) "English_United States.1252"
string(1) "."
string(1) ","
string(3) "USD"
string(1) "$"
string(1) "."
string(1) ","
++++++++++++++++++++++
string(2) "ru"
string(1) ","
string(1) " "
string(3) "RUB"
string(1) "?"
string(1) ","
string(1) " "
++++++++++++++++++++++
string(%d) "Czech_Czech%s.1250"
string(1) ","
string(1) " "
string(3) "CZK"
string(2) "Kč"
string(1) ","
string(1) " "
++++++++++++++++++++++
string(19) "Serbian_Serbia.1250"
string(1) ","
string(1) "."
string(3) "RSD"
string(3) "RSD"
string(1) ","
string(1) "."
++++++++++++++++++++++
+++DONE+++