Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119436 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11318 invoked from network); 1 Feb 2023 03:46:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Feb 2023 03:46:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6A0C71804BE for ; Tue, 31 Jan 2023 19:46:10 -0800 (PST) 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, T_SCC_BODY_TEXT_LINE 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-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 31 Jan 2023 19:46:06 -0800 (PST) Received: by mail-vs1-f44.google.com with SMTP id y8so18344021vsq.0 for ; Tue, 31 Jan 2023 19:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kY8yXfO0h9Exeyeixgxba//OjGu9aszN9hA81kVUP+U=; b=TNKEw5czvrYtTKd3A5lwrbQ6Zm6g+tAKD9Dj/WiejVH6tdPvOgEL2P8vzzuVj3jN3i 9Ye8rvWYA7hTHLNdQz3MhXsey20eJvOONgny11pc8v9T13fMGTPVM/sTYma1H6jgmXFU Wp6LAEcTL9j9YOR9uC+W6GdCWeBsjQfv/nhbCD9gYxP1wFqaHGpZjvLdw4lpj1Ewlfj/ z841D3vGKIuFy1Vw/K0e2gTvLXEjB4ADoos9n/phmWdc3njVlYGfSUPEeeJBREXvyNOz EA4e4Ikh+i3VpnI9H4pueAFfH3HLMhkr6PhMJmhteJELSU6MdYbHxwpML2+xhOup2ksq m2nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kY8yXfO0h9Exeyeixgxba//OjGu9aszN9hA81kVUP+U=; b=SRqzFKdub0Gb0BixajQZcECc1EH+pxC/dunhAlTgvhA2uvXUmoqMrqg9YG6DobrAwk HoX1WP7csGBFHDfp9wEKVFLzr0ed8RvtlX/ojvSbgeRl6oS0WVCdLwUXKgy2HLuE1BhO NCdFk/GdQiOLZnxfAkeUjKIFjWY0qFhA9Xe1Z+LUXuyhAFc+RRXoreWMOxOOetqjwWht 1YPTKAbnK5CZx5MKtdCzhGVqGuqEpPqZwE0AcvlhcnofipKDkgllReuEJbvo5h0NC1vI 1Knk9C64SFyrezRPg91rAPZ535tMFmNx3mjwQJtXdfoFcjv877s/PXN4pG4poPmMDw6K rbEw== X-Gm-Message-State: AO0yUKULNXVsgTqKgMRZBRUxt3JXYk0OSa1oR+gcBJuutsFDKMtS3IQ0 iyDa1+96pIGjKuOWE6IhHNzCnc8c2S8FCDzyLyI= X-Google-Smtp-Source: AK7set/ZEi4Chid1RbwGQ8LEgu/GF7nxHEtXgTYjJiWF7gzXlrN4IqIH8gHbWzMYQaVMmyH6SFqFk6zpGq8U+cPHa8s= X-Received: by 2002:a67:db15:0:b0:3e8:f2b:9aae with SMTP id z21-20020a67db15000000b003e80f2b9aaemr192793vsj.86.1675223166104; Tue, 31 Jan 2023 19:46:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 31 Jan 2023 22:45:55 -0500 Message-ID: To: =?UTF-8?Q?Ond=C5=99ej_Mirtes?= Cc: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000bc381c05f39b49ff" Subject: Re: [PHP-DEV] [RFC] [Discussion] Typed class constants From: mbniebergall@gmail.com (Mark Niebergall) --000000000000bc381c05f39b49ff Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I initiated a conversation about the typed constants RFC back in March 2022: https://externals.io/message/117406 I had updated the RFC page, but it looks like the changes were reverted in December 2022. The updated version I was working on was: https://wiki.php.net/rfc/typed_class_constants?rev=3D1648644637 The updated RFC looks good, thanks for working on it. You may want to review the revised version I had worked on for implementation ideas, and review the previous conversations. The primary concept missing is declared but unassigned class constants, which must then be assigned a value in the concrete class. See the section on my revised version "Inheritance and variance". That'll be a question of if that can or should be included in this RFC or not. It provides the most value, allowing for inheritance from a parent class to ensure the value is set and typed in the concrete class. - Mark Niebergall On Tue, Jan 31, 2023 at 5:55 PM Ond=C5=99ej Mirtes wrote= : > I fully support this RFC. PHPStan added support for PHPDoc types in class > constants some time ago - it=E2=80=99s useful to rely on the same constan= t type > even in subclasses when accessing them via static:: or $object::. > > On Tue 31. 1. 2023 at 22:01, M=C3=A1t=C3=A9 Kocsis wrote: > > > Hi Everyone, > > > > A few years ago, Benas Seliuginas announced the "Typed constants" RFC ( > > https://externals.io/message/110755) which apparently had a > > positive reception overall. > > Unfortunately, there were some issues with the implementation (namely, > with > > the parser) > > so the RFC was stuck. > > > > A few weeks ago, I reached out to Benas whether he intended to resurrec= t > > the proposal, but > > due to time constraints, he couldn't, and was OK with me continuing it. > > With some help from > > Bob Weinand, I managed to overcome the implementation difficulties, and > > adapted it > > to the newly added type-related features. > > > > Please find the updated RFC here: > > https://wiki.php.net/rfc/typed_class_constants. > > > > Regards, > > M=C3=A1t=C3=A9 > > > -- > > Ond=C5=99ej Mirtes > --000000000000bc381c05f39b49ff--