Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109671 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71025 invoked from network); 15 Apr 2020 22:24:20 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 15 Apr 2020 22:24:20 -0000 To: internals@lists.php.net References: Date: Wed, 15 Apr 2020 22:54:21 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 46.59.72.204 Subject: Re: [RFC] [DISCUSSION] Locale-independent float to string cast From: ajf@ajf.me (Andrea Faulds) Message-ID: Hi, Máté Kocsis wrote: > Hi Internals, > > Together with George, I'd like to propose an RFC for a long-standing > problem PHP has: > casting floats to string depends on the locale settings. As this behaviour > is nonsense, and > because it can cause quite serious problems, we would like to get rid of > locale-dependence > in PHP 8. > > Please find our RFC at > https://wiki.php.net/rfc/locale_independent_float_to_string. > > Regards, > George and Máté > Just a little thing, saying “certain locales (notably the German, French, and Spanish ones)” perhaps understates the issue. Most non-English-speaking countries do not use . as the decimal separator! https://en.wikipedia.org/wiki/Decimal_separator#Arabic_numerals Anyway, thank you for this RFC, I think fixing this is long, long overdue. I expect there could be a serious BC impact for certain PHP users, but I don't think there is a good long-term solution for this short of forcing such code to be updated. As a potential improvement, I would suggest to try to be closer to comprehensive in documenting which functions' behaviour changes or does not. For example, this RFC doesn't currently say what happens to settype() and print_r(). Thanks, Andrea