Download src/php/php-src/ext/json/tests/bug42785.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 629 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/bug42785.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/json/tests/bug42785.phpt
-
curl -L -o bug42785.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/json/tests/bug42785.phpt
629 Bytes
| --TEST-- | |
| Bug #42785 (Incorrect formatting of double values with non-english locales) | |
| --INI-- | |
| serialize_precision=-1 | |
| --SKIPIF-- | |
| if (!setlocale(LC_CTYPE, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1", "ISO8859-1")) { | |
| die("skip locale needed for this test is not supported on this platform"); | |
| } | |
| --FILE-- | |
| setlocale(LC_ALL, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1", "ISO8859-1"); | |
| $foo = array(100.10,"bar"); | |
| var_dump(json_encode($foo)); | |
| $bar1 = new stdClass; | |
| $bar1->a = 100.10; | |
| $bar1->b = "foo"; | |
| var_dump(json_encode($bar1)); | |
| --EXPECT-- | |
| string(13) "[100.1,"bar"]" | |
| string(21) "{"a":100.1,"b":"foo"}" | |