Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-20 Thread Rowan Tommins
Hi Niklas, On Mon, 20 Apr 2020 at 07:48, Niklas Keller wrote: > > What's more important here IMO is the restriction of inheritance, > mainly because the raw arguments are exposed via reflection and won't > be compatible between parent and child attribute in any case. > Could you explain a bit

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-19 Thread Niklas Keller
Hey Benjamin, thanks for your answers! > <> would best require a namespace (PHP\Attributes) as I feel > claminig "Attribute" class in the main namespace might cause problems for > users. While this is true, I don't see how Attribute is different to any classes introduced in the "recent" versions

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-19 Thread Benjamin Eberlei
On Sun, Apr 19, 2020 at 11:30 PM Niklas Keller wrote: > Hey Benjamin, > > I haven't really followed the discussion, so sorry if anything I'm > writing has already been discussed. > > Attributes / annotations are one of the two things I currently miss > most in PHP (the other being generics), so t

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-19 Thread Niklas Keller
Hey Benjamin, I haven't really followed the discussion, so sorry if anything I'm writing has already been discussed. Attributes / annotations are one of the two things I currently miss most in PHP (the other being generics), so thanks for the work on that! There are a few points that seem odd to

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-18 Thread Guilliam Xavier
On Fri, Apr 17, 2020 at 6:11 PM Theodore Brown wrote: > > the RFC says that the alternate T_ATTRIBUTE `@:` token has the > downside "that it does not permit whitespace in attribute names to > allow detecting the ending of the declaration." Can you provide an > example of an attribute name containi

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-17 Thread Theodore Brown
On Fri, Apr 17, 2020 at 12:43 PM Benjamin Eberlei wrote: > On Fri, Apr 17, 2020 at 6:11 PM Theodore Brown wrote: > > > Can you provide an example of an attribute name containing whitespace > > that would be allowed with the shift left/right tokens but not with the > > attribute token? > > This

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-17 Thread Benjamin Eberlei
On Fri, Apr 17, 2020 at 6:11 PM Theodore Brown wrote: > On Fri, Apr 17, 2020 at 5:49 AM Benjamin Eberlei > wrote: > > > As there has only been minimal new discussion after the last changes to > the > > RFC I wanted to give a heads up that I will open the vote on Monday > > afternoon. > > > > If

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-17 Thread Rowan Tommins
On Fri, 17 Apr 2020 at 17:11, Theodore Brown wrote: > Consider this example using the shift left/right token syntax: > > ```php > <> 1, 4 << 1)>><> 1, 4 << 1)>> > function foo() {} > ``` > > To me the same thing using the T_ATTRIBUTE syntax is far more readable: > > ```php > @:BitShiftExample(4 >

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-17 Thread Theodore Brown
On Fri, Apr 17, 2020 at 5:49 AM Benjamin Eberlei wrote: > As there has only been minimal new discussion after the last changes to the > RFC I wanted to give a heads up that I will open the vote on Monday > afternoon. > > If you have further remarks or questions about the RFC, please let me know.

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-16 Thread Benjamin Eberlei
On Thu, Apr 16, 2020 at 4:41 PM Nicolas Grekas wrote: > Le jeu. 16 avr. 2020 à 16:29, Larry Garfield a > écrit : > >> On Thu, Apr 16, 2020, at 1:46 AM, Benjamin Eberlei wrote: >> >> > > > > 3. I see the most common case for attributes being getting the >> object >> > > > > version. With the ref

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-16 Thread Nicolas Grekas
Le jeu. 16 avr. 2020 à 16:29, Larry Garfield a écrit : > On Thu, Apr 16, 2020, at 1:46 AM, Benjamin Eberlei wrote: > > > > > > 3. I see the most common case for attributes being getting the > object > > > > > version. With the reflection API as currently described, I see two > > > > > shortcomin

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-16 Thread Larry Garfield
On Thu, Apr 16, 2020, at 1:46 AM, Benjamin Eberlei wrote: > > > > 3. I see the most common case for attributes being getting the object > > > > version. With the reflection API as currently described, I see two > > > > shortcomings. > > > > > > > > A) I can't tell if an attribute has a valid obje

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-15 Thread Benjamin Eberlei
On Tue, Apr 14, 2020 at 6:14 PM Larry Garfield wrote: > On Tue, Apr 14, 2020, at 10:42 AM, Benjamin Eberlei wrote: > > On Tue, Apr 14, 2020 at 5:24 PM Larry Garfield > > wrote: > > > > 2. Regarding sub-annotations, can you still do classes as parameters > even > > > if not as an annotation marke

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-14 Thread Larry Garfield
On Tue, Apr 14, 2020, at 10:42 AM, Benjamin Eberlei wrote: > On Tue, Apr 14, 2020 at 5:24 PM Larry Garfield > wrote: > > 2. Regarding sub-annotations, can you still do classes as parameters even > > if not as an annotation marker? Eg: > > > > <> > > function foo() > > > > Or is that also a no-go

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-14 Thread Benjamin Eberlei
On Tue, Apr 14, 2020 at 5:24 PM Larry Garfield wrote: > On Tue, Apr 14, 2020, at 6:00 AM, Benjamin Eberlei wrote: > > Hi everyone, > > > > I have updated the RFC with much of the feedback received here, on > Twitter > > and Reddit. > > > > https://wiki.php.net/rfc/attributes_v2 > > > > The follow

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-14 Thread Larry Garfield
On Tue, Apr 14, 2020, at 6:00 AM, Benjamin Eberlei wrote: > Hi everyone, > > I have updated the RFC with much of the feedback received here, on Twitter > and Reddit. > > https://wiki.php.net/rfc/attributes_v2 > > The following changes were made: > >- Changed to support the same attribute mu

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-14 Thread Benjamin Eberlei
On Tue, Apr 14, 2020 at 3:04 PM Nicolas Grekas wrote: > Hi Benjamin, > > I have updated the RFC with much of the feedback received here, on Twitter >> and Reddit. >> >> https://wiki.php.net/rfc/attributes_v2 > > > Thanks for the update and for giving this a try! > > I'm wondering about nested ann

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-14 Thread Benjamin Eberlei
On Tue, Apr 14, 2020 at 2:56 PM Iván Arias wrote: > > > Hi everyone, > > > > I have updated the RFC with much of the feedback received here, on > Twitter > and Reddit. > > > > https://wiki.php.net/rfc/attributes_v2 > > > Hi Benjamin, > > Thanks a lot for you effort, same for Martin. I really hope

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-14 Thread Nicolas Grekas
Hi Benjamin, I have updated the RFC with much of the feedback received here, on Twitter > and Reddit. > > https://wiki.php.net/rfc/attributes_v2 Thanks for the update and for giving this a try! I'm wondering about nested annotations: as you know, they're quite common in apps that use doctrine/a

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-04-14 Thread Iván Arias
> Hi everyone, > > I have updated the RFC with much of the feedback received here, on Twitter and Reddit. > > https://wiki.php.net/rfc/attributes_v2 Hi Benjamin, Thanks a lot for you effort, same for Martin. I really hope to see this in PHP8. I have a simple question. From the RFC: > Attribut

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-03-10 Thread Michał Brzuchalski
pon., 9 mar 2020 o 15:45 Benjamin Eberlei napisał(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

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-03-09 Thread Benjamin Eberlei
On Mon, Mar 9, 2020 at 8:30 PM David Rodrigues wrote: > As I am not a good expert on parser (not to say that I don't do anything), > could you tell me if I can write a note like that? > > <<[space]Annotation()[space]>> > << MyAnnotation(1, 2, 3) >> > > It's just because I think the code is more "

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-03-09 Thread Benjamin Eberlei
On Mon, Mar 9, 2020 at 8:19 PM Andrea Faulds wrote: > Benjamin Eberlei wrote: > > 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 R

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-03-09 Thread David Rodrigues
As I am not a good expert on parser (not to say that I don't do anything), could you tell me if I can write a note like that? <<[space]Annotation()[space]>> << MyAnnotation(1, 2, 3) >> It's just because I think the code is more "breathable". Until the PSR staff decides how best to write. Atenci