Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110774 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81976 invoked from network); 29 Jun 2020 14:05:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jun 2020 14:05:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C22341804CE for ; Mon, 29 Jun 2020 05:53:57 -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, 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-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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, 29 Jun 2020 05:53:57 -0700 (PDT) Received: by mail-ej1-f48.google.com with SMTP id ga4so16410368ejb.11 for ; Mon, 29 Jun 2020 05:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4IA1Eg19kNrTCeNv7qtaPV8pbzj0IgQhXldY+9tVF2c=; b=Zua9fGsXJ5f04M3AIZIYDc3fILmp2AQSclm7pYYNpyRp+JuKkGNwbiaSROY+hTdQ0y 1mWWhz6zb1UoJGaJMSWn/gzmBj4l5t5QvNohaIRKsXFspZvun4FBDtzJtnVLxzCGIjcR 5iHGi1Ga89XnEFwjiaGskb/Ck4wEmDex3xToYDP3Df+n4sSNg7A7EvOBBcmuB3s4GmXZ npdobLrm304CLIAM6hSolmrdhRPNRzQ12xQJMfbzPX+mjKXkBxtPGWG9OQA9apKVtGbK 4oIOpOFAWOzY5AqdFvr12S9vXx/fXMqiosVFbaWhdbLz37RzBMl+KnAROQZaClwGx02r rRqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4IA1Eg19kNrTCeNv7qtaPV8pbzj0IgQhXldY+9tVF2c=; b=MkyEMVE29SywUl1KhMvU+57iYqbmBSLB8Ie1l+6JFP/uGyn4TIkoRxlHsVlOzt62Ym LMtYJj50/9/c0iLUEgUEEU+swz++1XPqVTI9zIW0MaifspguMA0VcZ67FDf/uNDzDQ4K 7yQzr1jWjDaNWbzDdlXgwLWcRmOT179PKp/yuIGBvmu6iBNP2HnJ7sqDZ5yQCLllu09L vzsubaJk6IAcZnPB2GdRczY7YBfqPrXTuoHZkEg59J/LQQWRg0kmSc+u9qTrosImppnl V06DCux3MEuwpZtLUqtphoVbc16hHcQ7Kl2BzQxDOvoJlc9vzDjt3T7g03Yqem06Ior3 0P2Q== X-Gm-Message-State: AOAM533QsA1U+roi41MdQ7yuylHw/d0wvAWemHG6VepxZu6p+tONl2RD CP/W+rM+owVTN7T/AQNugaY= X-Google-Smtp-Source: ABdhPJxTAR0MgtVV5aMW6A1NzUFzdIRnYyTzKIzij5c/AllJDOy1JHTx16L6GOA6aWhJaleX+b84QQ== X-Received: by 2002:a17:906:ecb3:: with SMTP id qh19mr2066316ejb.273.1593435234785; Mon, 29 Jun 2020 05:53:54 -0700 (PDT) Received: from claude.fritz.box ([185.129.54.56]) by smtp.gmail.com with ESMTPSA id o8sm16147650ejj.102.2020.06.29.05.53.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 05:53:54 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) In-Reply-To: Date: Mon, 29 Jun 2020 14:53:53 +0200 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: "G. P. B." X-Mailer: Apple Mail (2.3608.80.23.2.2) Subject: Re: [PHP-DEV][RFC] Saner numeric strings From: claude.pache@gmail.com (Claude Pache) > Le 29 juin 2020 =C3=A0 12:30, G. P. B. a = =C3=A9crit : >=20 > Greetings internal, >=20 > While reviving the "Permit trailing whitespace in numeric strings" RFC = [1] > I didn't see Nikita's comment on Andrea's original PR which commented = on > the fact that we should get rid of the "leading-numeric string" = concept. >=20 > Therefore, mostly due to time constraints, I've merge the trailing > whitespace RFC with the removal of this concept in the following RFC: > https://wiki.php.net/rfc/saner-numeric-strings >=20 > The main gist is to convert all E_NOTICEs =E2=80=9CA non well formed = numeric value > encountered=E2=80=9D to the usual E_WARNING =E2=80=9CA non-numeric = value encountered=E2=80=9D and > allow trailing whitespaces, which would be most reasonables cases = where the > E_NOTICE has been emitted. >=20 > This RFC is heavily based on Andrea's original RFC [1] and I would = like to > thank her once more for the preliminary work she's done that I could = reuse. >=20 > Best regards >=20 > George P. Banyard >=20 > [1] https://wiki.php.net/rfc/trailing_whitespace_numerics Hi, It is not clear for me, by reading the RFC, whether or not the behaviour = of either implicit or explicit conversion of so-called leading numeric = string will be preserved, beyond some Notices that will be converted to = Warnings in the implicit case. For example, does (int) "2px" still = produce 2, even when the string is now considered as non-numeric? I think it is important to make sure that the current results of casting = to int/float will not change. For example, I can imagine some script = that reads a CSS value like "2px" and does some calculation on it, = converting it to a number on the process. A Warning instead of a Notice = will prompt the programmer to add explicit casts, which is probably a = good thing. But changing the casted value to 0 would lead to bugs that = are (1) harder to detect especially if the program already uses explicit = casts, and (2) harder to correct. =E2=80=94Claude