Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113711 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63440 invoked from network); 23 Mar 2021 06:21:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Mar 2021 06:21:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 88BA01804D8 for ; Mon, 22 Mar 2021 23:17:07 -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-Virus: No X-Envelope-From: Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 ; Mon, 22 Mar 2021 23:17:07 -0700 (PDT) Received: by mail-ej1-f43.google.com with SMTP id u5so25188964ejn.8 for ; Mon, 22 Mar 2021 23:17:06 -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=3OBQATvLSaKizE+J8EcgvTEJXEohitgiqcvFHz37QYQ=; b=mP9jo32QJdYaM9AtdEU12oGDsEjn5QrAmtxa2PC9s1v9oSchUIHXvIMcbAN41Ewsyk Ls75HifmR/ovYFXlSi5pBdOkSVxfaHRWl730vHbPIIjnP7B3XFFz0K45xjrn/MsVIJxJ WHh4/PDc0Hd8eVDXGvRRmtwECEUmw8qGs1aS6g+EYunU57jpi/EEXprhQT2n04TJLWXW RuFPkwFA/TUeB3u9fCfXAxSGXN/xCX1+Tdb/C+WhDBIPhhcNyn3CcASMGvS8DoPsgwOv /wGolm8+8bCSVZCu2kARXWIQTSOzzJVqhloQZfXHCEZp+7KXK6EnYdYJR9RANZaSp0Zb QTnw== 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=3OBQATvLSaKizE+J8EcgvTEJXEohitgiqcvFHz37QYQ=; b=jp0BVIxcDlZppJGGfk6SQcVaRvNWtonBYwymhTOL6Sj4P4O6CjIrFG8ozEgJvRAQ9c S8cqOKN+ri3y2JxnSINeAwjYMXLlwmhzC9tdsjSZ/lV8vApo2x5+Cf9fdLT5rfBnLGj5 1AFXmrcJjnczcF2Ct0s89vQtjyqKx5H6cV8cnA0q3pUH6/7cKnvXFE6FJmtebeoJ8ccS lOTFnxcJUxQahw2xlQ9fUwt9tq6ViTRxo3NEb/93sZq0pC6MWWAnUYn4cvnum49q1sFz vdV4IfmZxc6+GOwKHoRJ8vlJ2gkMFZdMQYVLWRlXvsmNhxuPXzEsi4uYk2XV4rM7kGOi MIWA== X-Gm-Message-State: AOAM533Vv5SREAEPujJZxAEXAAwdzq0duReg5ZkFQ6lk54GU1Kx83wUY StWEcMbatjCi9+FYURwIvi7ShpPaZTXufd8OaxE= X-Google-Smtp-Source: ABdhPJwNc6EhQ5f36C+qEswrTM8nKkehPfVAVXC7eG/hMtnE2bB+hPXt/9FB8fj5/6IJCaxKUxIL2jhaoFFAoylVtIU= X-Received: by 2002:a17:906:414e:: with SMTP id l14mr3198721ejk.406.1616480224985; Mon, 22 Mar 2021 23:17:04 -0700 (PDT) MIME-Version: 1.0 References: <31987585-0286-1e0a-adcb-51d2edec0145@gmx.net> In-Reply-To: Date: Tue, 23 Mar 2021 06:16:54 +0000 Message-ID: To: Andreas Leathley Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000098c49d05be2e21f4" Subject: Re: [PHP-DEV] [RFC] Deprecate implicit non-integer-compatible float to int conversions From: george.banyard@gmail.com ("G. P. B.") --00000000000098c49d05be2e21f4 Content-Type: text/plain; charset="UTF-8" On Thu, 4 Mar 2021 at 17:49, G. P. B. wrote: > On Thu, 4 Mar 2021 at 13:23, Andreas Leathley wrote: > >> On 04.03.21 14:07, G. P. B. wrote: >> > This new version of the RFC can be found on the wiki: [2] >> > https://wiki.php.net/rfc/implicit-float-int-deprecate >> >> I like the RFC, but I think the diagnostic messages will be hard to >> understand when they come up in real scripts, especially because they >> can be platform-dependent and can have two different reasons, and >> "non-compatible" is not self-explanatory. Giving a very specific message >> would be more helpful for people experiencing these errors, something >> like: >> >> * Implicit conversion to int from float(-string) with fractional part >> * Implicit conversion to int from float(-string) which is outside of >> int range (=> maybe also mentioning the range of the platform) >> >> (Maybe there are additional possible errors to consider, but those two >> seem two obvious possibilities) >> > > The other cases would be converting from infinity (+ or -) or a NaN value. > > But having specific messages is a reasonable enhancement but does make > the implementation more complicated as one needs to determine what is > causing > the incompatibility. > > I'll have a think about this. > > Best, > > George P. Banyard > Amended the RFC and implementation so the incompatible-integer float value is shown in the deprecation warning. Latest version can as usual be found here: https://wiki.php.net/rfc/implicit-float-int-deprecate I would like to move this to voting at the end of the week as it's been about a month since the initial discussion about the RFC [1] started. Best regards, George P. Banyard [1] https://externals.io/message/113077 --00000000000098c49d05be2e21f4--