Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111920 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66679 invoked from network); 22 Sep 2020 15:03:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Sep 2020 15:03:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A53B618050A for ; Tue, 22 Sep 2020 07:13:20 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 22 Sep 2020 07:13:20 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id B5F0AEC8 for ; Tue, 22 Sep 2020 10:13:19 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Tue, 22 Sep 2020 10:13:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=WScjoE 40olKpPjZc+Q828xMtz85Pd+1+AUpRP4tSlEg=; b=L0cfZulmgFrMSapbH9psmF 20COlLjDS0wpl2bcSGJ4KvGjOVz5NQLRGqlSlfvzlR1/NHKrYs/p1zIsu8fBccfV ShQYLMwo3HIFrKvzd/UZjP43JcCwDoBgy6dEKjoVTD56o1QStL7eB2/NsYo2Gqv2 3oamnDkTInaxaMXGSTsWCFAZaoigqlYEvn7dYNd+BkxNIVESJ/TlG0ycg5J+mu35 CmARXp+CEDomZBK0QvBUf1yNMC2NRMzsw49FqD6vGk6tfbRes9CziJYMMD1OFiDX qY1ElVfp48/vVFoXOHG4y5+UkwmLkHbjD5xMPk3W2FGr2WqmtSPVBEu6ymj0i6BA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeggdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepkeetleehffegfedvudefueejkefhvddtueeuvdevteei veehledugeejudfhhfetnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghr fhhivghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 167DC1420114; Tue, 22 Sep 2020 10:13:19 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-352-gbd49b4e-fm-20200922.003-gbd49b4ec Mime-Version: 1.0 Message-ID: In-Reply-To: References: Date: Tue, 22 Sep 2020 09:12:58 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Attributes on property groups From: larry@garfieldtech.com ("Larry Garfield") On Tue, Sep 22, 2020, at 7:51 AM, Nikita Popov wrote: > Hi internals, > > Currently, placing an attribute on property (or constant) groups is not > allowed: > > class Foo { > #[NonNegative] > public int $x, $y, $z; > } > // Fatal error: Cannot apply attributes to a group of properties > > This is a case that was not explicitly mentioned in the RFC and we decided > to be conversative when landing the initial implementation. > > However, this restriction seems pretty arbitrary to me, and I think we > should remove it. While there is some potential ambiguity as to whether the > attribute applies to all properties or only the first one, I think the > general expectation is that it should apply to all properties, just like > the property type does. > > PR to allow this: https://github.com/php/php-src/pull/6186 > > Any thoughts on this? > > Regards, > Nikita I don't know if it's safe to change so close to RC; I'd be fine with leaving it for a version since grouping is in practice so rare. If you decide to change it now, however, I agree that applying to all items in the group is the least-surprising approach. --Larry Garfield