mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
f64be0b013
The WDDX specification[1] requires to serialize floats with a decimal point, but `snprintf()` is locale-dependent and may use a decimal comma. We fix that afterwards by replacing an eventual comma with a point. [1] <http://xml.coverpages.org/wddx0090-dtd-19980928.txt>
19 lines
565 B
PHP
19 lines
565 B
PHP
--TEST--
|
|
Bug #73793 (WDDX uses wrong decimal seperator)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('wddx')) print 'skip wddx extension not available';
|
|
if (setlocale(LC_NUMERIC, ['de_DE', 'de_DE.UTF-8', 'de-DE']) === false) {
|
|
print 'skip German locale not available';
|
|
}
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
setlocale(LC_NUMERIC , ['de_DE', 'de_DE.UTF-8', 'de-DE']);
|
|
var_dump(wddx_serialize_value(['foo' => 5.1]));
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
string(120) "<wddxPacket version='1.0'><header/><data><struct><var name='foo'><number>5.1</number></var></struct></data></wddxPacket>"
|
|
===DONE===
|