[VOTE] Attributes v2 RFC Vote is open

php.internals

Benjamin Eberlei

6 years ago
Hello, I have opened the vote on the Attributes v2 RFC. The voting will be open until two weeks from now, May 4th 2020, noon UTC. RFC: https://wiki.php.net/rfc/attributes_v2 Thank you everyone for taking part in the detailed discussion. greetings Benjamin

Theodore Brown

6 years ago
On Mon, Apr 20, 2020 at 4:18 AM Benjamin Eberlei <kontakt@beberlei.de> wrote: > I have opened the vote on the Attributes v2 RFC. The voting will be > open until two weeks from now, May 4th 2020, noon UTC. > > RFC: https://wiki.php.net/rfc/attributes_v2 It's unfortunate that the RFC doesn't more fully enumerate the advantages/disadvantages of the proposed syntax options. It only points out that the T_ATTRIBUTE `@:` syntax is shorter and more familiar, but claims that it has the downside of not permitting whitespace in attribute names (it's not clear this is really an advantage - just an opportunity for arguments about code style). But if you look at the pull request for the `@:` syntax [1], there is a much more complete comparison. For example, the `<<>>` syntax is more verbose, unfamiliar to most people, and even Hack seems to be moving away from it. Furthermore, because it reuses existing tokens with a different meaning, it results in expressions that can be very difficult to read. For example: ```php const Baz = 2; <<FooAttribute(2 * 3 + 3)>><<Bar(4 + 5 * 2)>> <<BarAttribute(2 * (3 + 3)>>Baz, (4 + 5) * 2)>> function foo() {} ``` If PHP gets generics in the future (hopefully it does), the syntax will likely get even more confusing (if not a lot of PHP developers use shift tokens, certainly a lot more will use generics). The `@:` syntax makes it much more obvious where separate attributes are being used vs. constant expressions containing a shift token: @:FooAttribute(2 * 3 + 3) @:Bar(4 + 5 * 2) @:BarAttribute(2 * (3 + 3)>>Baz, (4 + 5) * 2) function foo() {} ``` In addition, the `@:` syntax is less verbose, and much closer to the attribute syntax developers are familiar with using in PHPDoc comments, as well as the syntax with precedence in other languages such as Java and Python. The syntax choice is very important, the language will be stuck with it for a very long time! Best regards, Theodore [1]: https://github.com/kooldev/php-src/pull/2

Andrew Faulds

6 years ago
Hi, Benjamin Eberlei wrote:
> Hello, > > I have opened the vote on the Attributes v2 RFC. The voting will be open > until two weeks from now, May 4th 2020, noon UTC. > > RFC: https://wiki.php.net/rfc/attributes_v2 > > Thank you everyone for taking part in the detailed discussion. > > greetings > Benjamin >
Thanks for putting this to a vote. I remember I had some comments about autoloading behaviour and you changed the behaviour in the RFC, but I didn't get around to reading it again. I am concerned though that it doesn't seem to say anymore when autoloading happens, if at all? Can that be clarified? Thanks, Andrea

Benjamin Eberlei

6 years ago
Hello everyone, i just closed the vote. Attributes v2 was accepted with 51 yay, 1 nay. The selected syntax will be <<Attribute>>. Thank you everyone for participating in the discussion and vote! We will start work on merging the patch (quite a few review comments are already addressed). In addition we will probably put up discussion for some adjustments/additions for a follow up RFC over the next few days. greetings Benjamin On Mon, Apr 20, 2020 at 11:18 AM Benjamin Eberlei <kontakt@beberlei.de> wrote:

Larry Garfield

6 years ago
On Mon, May 4, 2020, at 7:05 AM, Benjamin Eberlei wrote:
> Hello everyone, > > i just closed the vote. Attributes v2 was accepted with 51 yay, 1 nay. The > selected syntax will be <<Attribute>>. > > Thank you everyone for participating in the discussion and vote! > > We will start work on merging the patch (quite a few review comments are > already addressed). In addition we will probably put up discussion for some > adjustments/additions for a follow up RFC over the next few days. > > greetings > Benjamin > > On Mon, Apr 20, 2020 at 11:18 AM Benjamin Eberlei <kontakt@beberlei.de> > wrote: > > > Hello, > > > > I have opened the vote on the Attributes v2 RFC. The voting will be open > > until two weeks from now, May 4th 2020, noon UTC. > > > > RFC: https://wiki.php.net/rfc/attributes_v2 > > > > Thank you everyone for taking part in the detailed discussion. > > > > greetings > > Benjamin
Calling it now: This is going to be Drupal 8's "signature feature" the same way property types was for 7.4. Woohoo! --Larry Garfield

Benas IML

6 years ago
I would actually go as far as to say that this is going to be PHP 8 signature feature. Best regards, Benas Seliuginas

Larry Garfield

6 years ago
On Mon, May 4, 2020, at 12:34 PM, Benas IML wrote:
> I would actually go as far as to say that this is going to be PHP 8 > signature > feature. > > Best regards, > Benas Seliuginas
... I spent way too long working on that project... *sigh* Yeah, PHP 8.0. :-P --Larry Garfield

Sebastian Bergmann

6 years ago
Am 04.05.2020 um 19:34 schrieb Benas IML:
> I would actually go as far as to say that this is going to be PHP 8 > signature feature.
It certainly is for me.