Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109262 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1690 invoked from network); 24 Mar 2020 11:39:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Mar 2020 11:39:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AC6CD1801FD for ; Tue, 24 Mar 2020 03:03:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 24 Mar 2020 03:03:43 -0700 (PDT) Received: by mail-il1-f170.google.com with SMTP id e8so16116092ilc.13 for ; Tue, 24 Mar 2020 03:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ROUhr/qK5hPFk0RzWm85h3eH4kMUwFahBQduc5jtSu0=; b=ue82bZOg44B+X/eb/Som8bK4Q3JJhpWlZRZDolHmuF7Fi6KbE5jLQAWAljHDkv5lva kJjhd47ZWO2LusGEh9O2xX1P9FVsjZ56VqGYJDT3k8n54WGte7RRdDkwSAsvem2tNdMm YurLeW+Zh51fxohx+JqX+GZ0Qe2B5G9oE0Tqy7exkCQvIZ2ORcZeVjZlc332vIIKX03p VofoQOkQg+rZJichwYcdRNY46/RGDtbMrLeIyIXep4BMnHzN6aYhn8hszT0/y0766819 iux3Gs4sbRjf8JgBITXV4PFvkeo0M2TVc0aA9bApht/QXRxJ0WHkqxb6OOjKFECId50z wosA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ROUhr/qK5hPFk0RzWm85h3eH4kMUwFahBQduc5jtSu0=; b=bTODwR1h40K9Ei2j/31YyuhcjAQCQa9pGzgw9dyKyy+h8b81KJXyEqpG2KjvXeo1g5 hJHxOAni9cW7ZADljcb2lb5ZvmcGiiph/SZ/9ihZ6QSyI6TQKb79puzY8ma3FJw7l568 ibGQn+oy84oy8OGfEfbh9Ii0qya+jZbZciLvPT5ftuSp8xgullEJ47FFxU5Ww5vZDXmE FO2jqNvxn6X92jJfG7oZmEo0b3j9VkVW31T0D+tUiHEgCdMI+IckTU0X8dN/M05U4WWO EdXK/yL7+Ny4n8NYS/vhYS92yQahOg/wBNvY2nMGWI8BmgIVq3titEFv8A3VpeJ/xtvZ /KkA== X-Gm-Message-State: ANhLgQ2SRikxLiwAqTnGSHv9DTJhN+kjtGFDp8to7Zj6Fsvh10OagXGz hN0HfeLwS+6I2byFZVV0jCnX6fbrqWZX3vM7vs4= X-Google-Smtp-Source: ADFU+vt/b3ZKMeZk/V8PrnvuqHZbmT4oe/IUtkEhDEcDT0PO0nx6Pl7M10bcBnCnX1rTD9Qp0dBTP2s9oNG/dN1uVKA= X-Received: by 2002:a92:a103:: with SMTP id v3mr18955387ili.194.1585044222721; Tue, 24 Mar 2020 03:03:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 24 Mar 2020 11:03:17 +0100 Message-ID: To: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000d9454e05a196dd36" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Locale-independent float to string cast From: kjarli@gmail.com (Lynn) --000000000000d9454e05a196dd36 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, This is a great RFC! Just one minor thing. > Outputting floats as strings in locales which change the decimal separator will have a slightly different output. In our opinion, the backward compatibility break won't be serious in practice In my opinion, this will be huge. I can't trace back where the thousands of possible conversions are used in legacy software. There's a variety of custom format functions, sprintf implementations, string casts, and number_format usages. Would it be possible to trigger a warning or deprecation when using a locale that would have a different result from what the new result will be? If I'd use a locale that results in `3.5`, I don't need a warning. If I use a locale that results in `3,5`, I would like to see a warning of sorts so I can fix this before untested legacy code will seriously break data exports. Regards, Lynn On Tue, Mar 24, 2020 at 10:40 AM M=C3=A1t=C3=A9 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 behaviou= r > 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=C3=A1t=C3=A9 > --000000000000d9454e05a196dd36--