Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110382 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 74729 invoked from network); 5 Jun 2020 05:15:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jun 2020 05:15:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E6450180211 for ; Thu, 4 Jun 2020 20:58:15 -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=-0.7 required=5.0 tests=BAYES_05,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-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) (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 ; Thu, 4 Jun 2020 20:58:12 -0700 (PDT) Received: by mail-io1-f68.google.com with SMTP id d7so8831734ioq.5 for ; Thu, 04 Jun 2020 20:58:12 -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=bOFhxS+5KLLle4ADkRj59gY549nWWzNyzYeJkkMs2zM=; b=G/qIMVUJ9C2UVYa7DADW/PwNheIzxSXhERz+ZBmfsAjRCG8wOx4UOKEBqg3OhSC/yI Z7xI2AlGLMX138aEBfa9SuE7CAQeyHMp8rk0iKiD6nKpHh4+zc9C6kjBdk+8PzfpLNH3 EQLdSuYR0OH51lhQbMggmfgvoGP/UJYKSdWJ7r5FiiHaNUdTf2q+nQDw9/fwV51BEAo0 m4QjijVgupwE6qeeJDxmL8SjWoiVABIwZhhpatOkNWsRo/Yb63z/7mFfGHRROvM9rNjM YEKXi5tnC6q+C35fZa/fy4SOGWai47BhSC54jr7Ia4NmP0V/sr90WssDuLlQkOXf/ZjJ esgg== 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=bOFhxS+5KLLle4ADkRj59gY549nWWzNyzYeJkkMs2zM=; b=Bwe5+ijL30JHMe0N8iGBgSjRBrzzVzJylh9lH6Dok55YYfuO2/JNcBN7lvAjir4VP7 ETdQHhpgFZs0vaOwzBKgIrBEU7BdmaITIS1fDY7g3QH7TzB/8arWWBQHRXkA6lKC0ztj Y/UGNJAjOJWZtT/OtnIY/HBGw0Nr0Ku3mi74A9bY2f2W9JNkldoSPMN8VrlFPIhnxbOo ZVFBh2NIOE5MTQK7oPcrPTfJ6DhMHqTrYsiWcBc/WQmk53yBhg4X6STGb0FibMe79m8k m30TPFuRqGjwVNwCePUdYOwE6pXB4jN8bUkOvpeozxxM4JvVuc8Y+avQybYJyjH54ROD fTdg== X-Gm-Message-State: AOAM5316K40SiAqSuTb6BphicbfhKFezbQIf40vJvvkJIzH8jWew3P7r Smq6y10X3dXdcJHHif7XS/GG7bLJWzODAdxDU5E= X-Google-Smtp-Source: ABdhPJya/5DwFwQMihuGUyo9KU+MbugdcTVGGl/1Oq7jNO6mW+6aOFWdd1XFdzjDheMsjIsetCx4DdDuNj0vX23zTYg= X-Received: by 2002:a6b:5f06:: with SMTP id t6mr6598099iob.88.1591329489576; Thu, 04 Jun 2020 20:58:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 4 Jun 2020 23:57:57 -0400 Message-ID: To: Benjamin Eberlei Cc: Benas IML , PHP Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: [RFC] Amendments to Attributes From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") Hi Benjamin, Overall, all these amendments are good in my opinion, but I'd like to challenge a few things: 1- On item 3, the acceptable targets would be: class, function, method, property, class constant, parameter or all. If possible, I'd like to ask if it's possible to expand this list and also allow attribute and constructor. 2- Also on item 3, the validation of PhpAttribute targets, it feels more natural to have this as an array instead of a bitwise or operator. Have you evaluated the performance penalty to judge your decision of bitwise vs array? 3- Repeatability should be on its own PhpAttribute. It would not block the expansion of the repeatability in future efforts. One possibility could be group repeated attributes as another PhpAttribute. Example: Multiple <> be folded into a <>. This code: <> <> Would be equivalent to (sorry if syntax is not 100% correct): <>, <> ])>> Considering: <> <> class Schedule { public string $cron; /* ... */ } <> class Schedules { public array value = []; // Holds an array of Schedule } 4- Now you might have recall about my initial thoughts on this subject, but inheritance is something that would be very interesting to see as part of this amendment. If we introduce something like <> to the Attribute definition, we could then mark the Attribute to be inherited to subclasses of attributed class, while keeping the default to do not inherit anything (like we have today). Cheers, On Thu, Jun 4, 2020 at 1:49 PM Benjamin Eberlei wrote: > > On Thu, Jun 4, 2020 at 12:54 PM Benas IML wrote: > > > Thank you for the update! Given that there is still an open issue, is the > > RFC proposing flags or a separate `<>` attribute? > > > > Good point, we came to the conclusion to simplify. Should attributes be in > the global namespace, then we shouldn't arbitrarily add more, so it will be > a flag. > At that point, because you rarely declare new flags we decided to merge > target and flags and only have one flag. You could do the following: > > <> > > > > > Best regards, > > Benas > > > > On Thu, Jun 4, 2020, 12:29 PM Benjamin Eberlei > > wrote: > > > >> I have changed back the rename from namespacing to Attributes\Attribute to > >> using just Attribute after a few discussions off list. The reasoning is > >> that it becomes more clear that a majority of core contributors strongly > >> prefers using the global namespace as the PHP namespace and opening up > >> this > >> point again makes no sense. So the state of the RFC is again what it was > >> when I originally posted it with renaming PhpAttribute to Attribute. > >> > >> Unless there is some new significant feedback I am going to open up this > >> RFC for voting on Monday next week. > >> > >> On Wed, May 20, 2020 at 7:07 PM Benjamin Eberlei > >> wrote: > >> > >> > Hi everyone, > >> > > >> > the Attributes RFC was rather large already, so a few things were left > >> > open or discussions during the vote have made us rethink a things. > >> > > >> > https://wiki.php.net/rfc/attribute_amendments > >> > > >> > These points are handled by the Amendments RFC to Attributes: > >> > > >> > 1. Proposing to add a grouped syntax < > >> > 2. Rename PhpAttribute to Attribute in global namespace (independent of > >> > the namespace RFC) > >> > 3. Add validation of attribute class targets, which internal attributes > >> > can do, but userland can't > >> > 4. Specification if an attribute is repeatable or not on the same > >> > declaration and fail otherwise. > >> > > >> > Each of them is a rather small issue, so I hope its ok to aggregate all > >> > four of them in a single RFC. Please let me know if it's not. > >> > > >> > greetings > >> > Benjamin > >> > > >> > > -- Guilherme Blanco SVP Technology at Statflo Inc. Mobile: +1 647 232 5599