1--TEST-- 2Test that float to string and string to float casts are consistent 3--SKIPIF-- 4<?php 5if (setlocale(LC_ALL, 'invalid') === 'invalid') { die('skip setlocale() is broken /w musl'); } 6if (!setlocale( 7 LC_ALL, 8 "german", "de", "de_DE", "de_DE.ISO8859-1", "de_DE.ISO_8859-1", "de_DE.UTF-8", 9 "french", "fr", "fr_FR", "fr_FR.ISO8859-1", "fr_FR.ISO_8859-1", "fr_FR.UTF-8", 10)) { 11 die("skip locale needed for this test is not supported on this platform"); 12} 13?> 14--FILE-- 15<?php 16 17setlocale( 18 LC_ALL, 19 "german", "de", "de_DE", "de_DE.ISO8859-1", "de_DE.ISO_8859-1", "de_DE.UTF-8", 20 "french", "fr", "fr_FR", "fr_FR.ISO8859-1", "fr_FR.ISO_8859-1", "fr_FR.UTF-8", 21); 22 23$float = 1/3; 24$string = (string) $float; 25$float = (float) $string; 26 27printf("%.2f", $float); 28 29?> 30--EXPECT-- 310,33 32