Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115309 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21456 invoked from network); 6 Jul 2021 07:09:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jul 2021 07:09:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7EF841804CC for ; Tue, 6 Jul 2021 00:31:10 -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-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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, 6 Jul 2021 00:31:10 -0700 (PDT) Received: by mail-ed1-f54.google.com with SMTP id s15so26627470edt.13 for ; Tue, 06 Jul 2021 00:31:09 -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=kH4oOyVt3oFrdaDvUbYfThIzOpcRmIb0XscNW3GeIiU=; b=KsbkTXBrmyQ7TdKcj2Y41NL1qIN1EctArSs8x+On/LKOXZ+dHDUh5WI2YzUk8mEH9C O48BPbnfWcGsdKcCWuIlpL05EAykYk1OGmlUbxWNtAWlxxjDpbkXeHbN+kYOTjBV7y1x AkV3Y9H43j1Qrvb2rIyjR2OegOI0eCWqz6pfXUnpaQS1WZ+wCwFtchEBe6f/33PLPGmS oq+U5EAyWqNr/r3LTdNH2D3oCJPl5BNSFqSMpTM8PC7sWIpm0rs4B5PfYfLl2IAhAihh Ay2YXevBQc54rT8CrKM9txSDKWdbGxdDJQYt3pn7sQmxNkMImFG1v+js9QcI9UWBJism lj+Q== 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=kH4oOyVt3oFrdaDvUbYfThIzOpcRmIb0XscNW3GeIiU=; b=Jd6154B6K3RlEqgwHM485djzyo4wdr9v6aGLzhuKPZk4yuuhMe7V/VWl7SJHJQG1pB wIl1vSfu2sunCfhDqlz8WWV76lYWqmCHqfD6eq63GUZ7pzecBCz/mDb2MQK2rSiuQkUs uJN9o7d/aOYfC3Ora6e54Fa9WuKZZW/q6xZedQ/p+MZbNUOtdMa2Od1ZNYEY8quZWZRR WA1sfS5AtV9C00khgaegEx8H8wV7uMOZEKDGDF0HiZ86do3t8CLbneH+/MEjmmdcvQun CsY6+dBfAe+KCBDatV2E2Pl5sbqeWziVHcRHLyY+AHpxBNGX6Lb9rGiYCCYgS9O6MCpv oMIg== X-Gm-Message-State: AOAM532fAYZSLgw8rKvu1yKW3NjoyuXxPqPMiy5QbPXxc6ijUtaqHFik URBIT0D5jf0Zx1HbdJ7gFYOoiPfC6pJOaPp/UGs= X-Google-Smtp-Source: ABdhPJyOwQxFmFJtJCWxXB/tdTI5BBJVnAW6TF92wWonGPk6QBf46qvcfPRKM5mIwSD6XrTJNaYDL48250S22ouLWws= X-Received: by 2002:a05:6402:513:: with SMTP id m19mr21622867edv.299.1625556665019; Tue, 06 Jul 2021 00:31:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 6 Jul 2021 09:30:52 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000094b1ed05c66f67e1" Subject: Re: [PHP-DEV] [Vote] New in initializers From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --00000000000094b1ed05c66f67e1 Content-Type: text/plain; charset="UTF-8" Hi NIkita, I've opened voting on https://wiki.php.net/rfc/new_in_initializers. Voting > will close on 2021-07-14. > > Note that relative to the original RFC, new support is limited to parameter > default values, attribute arguments, static variable initializers and > global constant initializers, and not supported in property initializers > and class constant initializers. The discussion thread > https://externals.io/message/113347 has some extensive information on how > we got here. > I voted yes and I'm happy this will come to PHP. I realized I still have one concern that I want to share here, related to attributes: The RFC breaks the possibility to parse the arguments of an attribute in a generic and safe way. What I mean is that right now, attributes can be inspected while the corresponding classes are not installed, due eg to a missing optional dependency. This behavior is what makes attributes truly declarative: one can ignore what they don't care about. Extra semantics can be carried out by classes without making the related attributes a mandatory dependency. I think there is a way to preserve this behavior and that we should look for it. If I may propose one: we might add a new ReflectionAttribute::getUninitializedArguments() method, that would return the same as ReflectionAttribute::getArguments(), except that it would put a ReflectionAttribute (or similar) instance in place of objects in the data structure. As a corollary, we might also want to enforce that only child classes of the Attribute class can be nested inside another Attribute (at least if we want to reuse ReflectionAttribute as a placeholder.) WDYT? Nicolas --00000000000094b1ed05c66f67e1--