Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103642 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1094 invoked from network); 27 Dec 2018 20:02:40 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 27 Dec 2018 20:02:40 -0000 To: internals@lists.php.net Date: Thu, 27 Dec 2018 17:33:35 +0100 In-Reply-To: References: User-Agent: tt v. 1.0.5; www.icosaedro.it/tt MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Posted-By: 87.6.54.127 Subject: Re: Inconsistent float to string vs. string to float casting From: salsi@icosaedro.it (Umberto Salsi) Message-ID: cmbecker69@gmx.de ("Christoph M. Becker") wrote: > Hi! > > Regarding the decimal separator (aka. decimal point), the behavior of > casting float to string is inconsistent with casting string to float. > [...] I'm shocked... Lot of code here assumes (float) does the exact reverse of (string); forunately most servers are configures with the default locale "C", but I'm still concerned for libraries portability. Did you filed a bug for that? Anyway, here is some test code I wrote: