Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108945 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56092 invoked from network); 10 Mar 2020 13:37:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Mar 2020 13:37:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 771B11804F2 for ; Tue, 10 Mar 2020 04:58:21 -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,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-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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, 10 Mar 2020 04:58:20 -0700 (PDT) Received: by mail-oi1-f170.google.com with SMTP id k18so470472oib.3 for ; Tue, 10 Mar 2020 04:58:20 -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=paqwlHNUj2TJGiIbiQtuJk6fnEsy8AKP6l3FtjGIxIc=; b=kDzwJ9gb/I1vE7Xp7R1W2p2DrrI3pyJv+6UH0qrVuIPEvi7NYEuw4mAx40Umnkwshp HocQo2mOl/SQfnyAEL1fxqx86hL5cDgU8a882tCfVP/dYGAN5ftPAY4hTWm8EiLDhthG T/PbQ1puNKsMc6pzXeV7JO6DxAFjB9CL2eu0OxS9mhcxZkgF8hoCeO7z0Aym+apExXkS kcudkclwtRPpD79w+NjwyXSpnQMPMzTe8ub/Zhrj03P30HPvG5vTG5Jt8rOlciRtsAWX yMMB67pOmpoo5Do6ZHX1LJpkY5GYK4dXR7bdg39ZsapVWQxusViTylTDg5YZda6nfbSd eZcg== 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=paqwlHNUj2TJGiIbiQtuJk6fnEsy8AKP6l3FtjGIxIc=; b=DAH2aZqpVh29mNOkpocSPRRMPoOW6wsv45HNqRHqPiSZfn8KLOytOM1i8JdivMy5LN XeF18iCSrixpE/nkMFaDbyi9Bwq8Mk+sYJAievHjBzo4b7f0cpsoDpV24DmAaMdeFwbr 8AMMG16Nh4RFA38EWGPOECV+7viMpYqJkCxWfCdbuqVBPahcSN6TisLu2bPozRpyBAZO fQAcSSCyTs8RKEZowvaGB4sQ/g0AgR8khPg0y0xjFYhSDKaGgOaslzPFaLhz4Jps9NPz dRTAtx4AaWrYynK8sfdhyd0laNWOHnn9FbjT+4hpxFDAfgTvfF9AcISLK0KZxrLPss26 sADQ== X-Gm-Message-State: ANhLgQ2RpC2RNGaP8ISxp/kQ45H4sqHnz2srL9uW3EM8cnkzeloezjQS 6czoQ99uhZnw/ucg/7jmGwvFy7bsmzEHER0J+ew0LCjR6nU= X-Google-Smtp-Source: ADFU+vtLCB/z1FJGgZhOUUnzFEkLA0gBARNx1oxze9ZubtMpLBs7bnsgcp0sWIncXM++mS6tKf/h8AmX3DfBZEXw+ak= X-Received: by 2002:a05:6808:907:: with SMTP id w7mr799185oih.78.1583841500167; Tue, 10 Mar 2020 04:58:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 10 Mar 2020 12:58:08 +0100 Message-ID: To: Benjamin Eberlei Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000ff841f05a07ed569" Subject: Re: [PHP-DEV] Re: [RFC] Attributes v2 From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --000000000000ff841f05a07ed569 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable pon., 9 mar 2020 o 15:45 Benjamin Eberlei napisa=C5= =82(a): > On Mon, Mar 9, 2020 at 3:42 PM Benjamin Eberlei > wrote: > > > Hi all, > > > > I want to resurrect Dmitrys Attributes RFC that was rejected for 7.1 in > > 2016 with a few changes, incorporating feedback from the mailing list > back > > then and from talking to previous no voters. > > > > The RFC is at https://wiki.php.net/rfc/attributes_v2 > > > > A working patch is at https://github.com/beberlei/php-src/pull/2 though > > work around the details is still necessary. > > > > The RFC contains a section with common criticism and objections to > > attributes, and I hope to have collected and responded to a good amount > > already from previous discussions. > > > > There is also a fair amount of implementation detail still up for debat= e, > > which is noted in "Open Issues". I have pre-committed to one approach, > but > > listed alternatives there. On these issues I am looking for your > feedback. > > > > Obviously I am looking for feedback on the whole RFC, not just the open > issues :-) > > > > > greetings > > Benjamin > > > Hi Benjamin, I'm really glad you're taking up the baton! IMHO a bunch of straw polls could provide a way more beneficial knowledge about feelings people who can vote up for this feature. What do you think? It could be good to discover the negative or positive feelings as well as "I'm not opposite" feelings. From what I can see now and I didn't think of it earlier are some details but we should ask the question how far we wanna go with this feature for its an initial shape. Are we gonna provide complete attributes feature like C#, Java etc. which allows for annotating annotations (whatever it's called for me annotations/attributes has no difference for now) meaning they allow to put metadata which puts restrictions on: 1. Usage of the attribute should be allowed once or multiple times regarding the same target? 2. Targetting attributes should be annotated - no matter if through an interface or annotation? 3. Allow for inheritance should be annotated - meaning when reading attributes for class Bar which extends Foo on which attributes are set, should I get attributes or not? 4. Should attributes be resolvable all the time, what if the class won't exist on runtime? In some languages like Java there are for eg. documentary annotations which live with code but are not stored on runtime. Or we simply want to provide a simple way of retrieving the metadata from class/trait/interface/properties/methods/functions without checking their repeateness, without inheritance, without validating the targets where they appear, and just allow to move any kind of attributes into the language and allow the userland to decide what to do with them and how to handle them properly? The thing which I haven't consider earlier and I find it nice features is the ability to filter annotations against some abstract/base annotation - it may be described as a better cause I do feel like it should be done through extending of the interface and not by an abstract class. Like from the RFC itself the `\Validator\Attributes\Attribute::class` it wouldn't make sense for it to be a class, not even an abstract class, there's probably no method which this abstract will provide. Attributes should be forbidden for instantiation and this if funny cause they do have a public __construct so they look like classes but are not actually classes which you should be allowed to instantiate wherever you want, right? So we agree it looks a little weird here but dunno if there's something we can do. cheers, Micha=C5=82 Brzuchalski --000000000000ff841f05a07ed569--