1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 14:12:38 +02:00
Files
archived-php-src/tests/lang/034.phpt
Máté Kocsis 4a816584a4 Make float to string casts locale-independent
From now on, float to string casting will always behave locale-independently.
RFC: https://wiki.php.net/rfc/locale_independent_float_to_string
Closes GH-5224

Co-authored-by: George Peter Banyard <girgias@php.net>
2020-05-08 10:52:23 +02:00

20 lines
464 B
PHP

--TEST--
Bug #12647 (Locale settings affecting float parsing)
--INI--
precision=14
--SKIPIF--
<?php # try to activate a german locale
if (setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8859-1") === FALSE) {
print "skip Can't find german locale";
}
?>
--FILE--
<?php
# activate the german locale
setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8859-1");
echo (float)"3.14", "\n";
?>
--EXPECT--
3.14