Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114941 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65492 invoked from network); 18 Jun 2021 09:24:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jun 2021 09:24:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D18031804A8 for ; Fri, 18 Jun 2021 02:41:55 -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,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-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 ; Fri, 18 Jun 2021 02:41:55 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id f8so3826184lfu.6 for ; Fri, 18 Jun 2021 02:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=craigfrancis.co.uk; s=default; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xmgAiyr6mimCc7hpl/XzkEfgEBmJMyOqBGrhYtZli8U=; b=XWFLzpVMCDMWSBVAIEFyVfKkwNnFoQLSC+Svo1e1yuCuKkIOK9q19uHli/K9iTDbOz KV6yQA0AtqOc8KuTxBfkfW7lBdgeOltYrUk8T128US6mEheGPgJfSoHozDzcjAE035H4 wIIMZP0vJauNibXs7BOTj+HfJ9L9NeWwG54CI= 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=xmgAiyr6mimCc7hpl/XzkEfgEBmJMyOqBGrhYtZli8U=; b=g+Pw0UvehHVWmpguxbjI4MIHh4K4hSad82ILSep0N9iVbG29vMgDDy6akqjKNDOkVw gpI9sRqiEt2f4X33xdU+1VsJgFvzasi2RGW/UDYAAS5hdh+6TxzW+U46cNQ9TIF6tVuL ZDrWBZ3r7EdHeVwvNRQidTrn4+Ow+JJhdDe45ry2LeaCixyvZnV1ba+5EthTPukkbTIM bNVPDmb7kA03wYcB1HPGZ6/s07NFjnHQ6FKKrnYu/eSCKNLQ3HwC96I22FiUNx9sqOrv F03RRPfZ/8KpMdR06gdcBwK/84BC4BWhKiEmoSP2HsCTnnY+TzKRPfjStLsojb2zIL2p mOEA== X-Gm-Message-State: AOAM531gk9DocGz+jZI7zGrwAPQWKG9+DWYeTttrT/TatuLS3wYefrSH W67a6EBCrJOCqVGMkCRCoMg/ucs16z4TrSOZpMxU7Zx3WR8= X-Google-Smtp-Source: ABdhPJzQMKRhPwQRaDGSQOLk6GZ23W13fsPhusnaesVKUgs/qjfQ5qRP84qXWqXtsi+/ds+xw+LUnU86VO3z6yMzzp0= X-Received: by 2002:a19:a406:: with SMTP id q6mr2446830lfc.616.1624009312660; Fri, 18 Jun 2021 02:41:52 -0700 (PDT) MIME-Version: 1.0 References: <2768d3ca-7c4f-77f3-d9f5-ff09b932fc80@processus.org> In-Reply-To: <2768d3ca-7c4f-77f3-d9f5-ff09b932fc80@processus.org> Date: Fri, 18 Jun 2021 10:41:41 +0100 Message-ID: To: Pierre Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000317ef805c50722f8" Subject: Re: [PHP-DEV] Re: [RFC] is_literal From: craig@craigfrancis.co.uk (Craig Francis) --000000000000317ef805c50722f8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 18 Jun 2021 at 8:48 am, Pierre wrote: > Le 18/06/2021 =C3=A0 08:00, Craig Francis a =C3=A9crit : > > Keep in mind it might also become a dedicated type in the future. > > Hello, > > If so, why the question should not be about the type name instead ? It > might raises different concerns and new arguments to this discussion ? > > What is this type ? What does it covers ? Can float, int, etc... be > literals as well ? Are those subtypes of their actual existing related > type ? What should be the behavior regarding user method typings, etc etc= ? > > Instead of introducing is_literal() may be directly introducing those > types could be a good idea as well ? Hi Pierre, On Monday we had the discussion about types: https://externals.io/message/114835#114846 The RFCs Future Scope was updated to note the suggestion from someniatko and Matthew about how this could be a type in the future (Joe has also shown an interest); where it was agreed that it should be added later. The discussions I=E2=80=99ve had about this flag have been to ensure it cov= ers all future use cases, including a dedicated type, where the function is an easy way to expose this flag to libraries today, so they can handle developer mistakes gracefully (rather than causing type errors), with types needing to have their own future/separate discussion. The type will still use this flag, so it will match the same definition in the RFC - strings defined by the programmer, and we will include integers after the feedback from Matthew (integers have always been considered, the only reason they were originally excluded was because I tried to keep the definition as small as possible, Matthew noted how they would help adoption, and no one can find a single issue with allowing them). The RFC also explains why floats and booleans are not included, so wouldn= =E2=80=99t be used by the type for the same reason. While adding a flag is an ideal to work towards, it is more important to have this simple change first, so it can start improving security immediately (so libraries don=E2=80=99t need to wait years for all of their supported versions of PHP to include the type), and it gives libraries full freedom in how they handle values which don=E2=80=99t have this flag. Hopefully this and the Future Scope section can also answer your questions. Craig --000000000000317ef805c50722f8--