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] [RFC] Attributes v2

2020-03-09 Thread Benjamin Eberlei
On Mon, Mar 9, 2020 at 11:03 PM Larry Garfield wrote: > On Mon, Mar 9, 2020, at 9:42 AM, 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] [RFC] Attributes v2

2020-03-09 Thread Benjamin Eberlei
On Mon, Mar 9, 2020 at 5:34 PM Paul M. Jones wrote: > Hi Benjamin, > > From the examples, am I to understand that the RFC introduces a top-level > namespace `\Php` ? > > Honestly didn't realize this and thought PhpToken would already be in the PHP namespace. I am going to think this over and

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

2020-03-09 Thread Larry Garfield
On Mon, Mar 9, 2020, at 5:02 PM, Larry Garfield wrote: > On Mon, Mar 9, 2020, at 9:42 AM, 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

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

2020-03-09 Thread Matthew Brown
Saying "the syntax makes my eyes bleed" is slightly useless feedback. You could say "it's hard to scan", but I don't even think that's true – prepending everything << makes it easy to pick out attributes in plain text at a glance, and one can assume that IDEs will help even further. Additionally

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

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

2020-03-09 Thread Benjamin Eberlei
On Mon, Mar 9, 2020 at 8:29 PM Robert Hickman wrote: > > > 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

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

2020-03-09 Thread Larry Garfield
On Mon, Mar 9, 2020, at 9:42 AM, 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

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

2020-03-09 Thread Aleksander Machniak
On 09.03.2020 15:42, Benjamin Eberlei wrote: > The RFC is at https://wiki.php.net/rfc/attributes_v2 Would it make sense to support this: <> <> <> function foo() {} in this form: << WithoutArgument; // comments allowed here SingleArgument(0); FewArguments('Hello', 'World'); >>

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

2020-03-09 Thread Benjamin Eberlei
On Mon, Mar 9, 2020 at 8:35 PM Aleksander Machniak wrote: > On 09.03.2020 15:42, Benjamin Eberlei wrote: > > The RFC is at https://wiki.php.net/rfc/attributes_v2 > > Would it make sense to support this: > > <> > <> > <> > function foo() {} > > in this form: > > << > WithoutArgument; //

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

2020-03-09 Thread Saif Eddin Gmati
Really excited to see the discussion about this feature being brought up again, thanks for working on this :) One thing I would suggest is to add a base interface `Attribute` and multiple sub-interfaces such as `ClassAttribute`, `MethodAttribute`, and `PropertyAttribute` just like hack lang (

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

2020-03-09 Thread Mike Schinkel
> On Mar 9, 2020, at 10:42 AM, 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

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

2020-03-09 Thread David Rodrigues
Another doubt: in relation to the PR ( https://github.com/beberlei/php-src/pull/2) it is called as "attributes", but seems better keep as "annotations". The Doctrine annotations is based in PHPDoc, are not? And it is basically the same thing, and annotations term is used in other languages. And

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

2020-03-09 Thread Mike Schinkel
> On Mar 10, 2020, at 12:24 AM, Matthew Brown wrote: > > I would not expect someone who’s never written a line of code to understand > attributes/decorators, just as I wouldn’t expect them to understand traits, > interfaces, or really any of the things one should know about in order to >

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

2020-03-09 Thread Matthew Brown
I would not expect someone who’s never written a line of code to understand attributes/decorators, just as I wouldn’t expect them to understand traits, interfaces, or really any of the things one should know about in order to write and maintain production-ready PHP code. If you want someone to

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

2020-03-09 Thread Mike Schinkel
> On Mar 9, 2020, at 9:36 PM, Matthew Brown wrote: > > Saying "the syntax makes my eyes bleed" is slightly useless feedback. That was just a header. There was elaboration right below it: "I find angle brackets extremely hard to read and fear — having trained many newbies in programming —

Re: [PHP-DEV] Bug Wrong resolution of "Late Static Binding" after self::method()

2020-03-09 Thread Rowan Tommins
On Mon, 9 Mar 2020 at 05:38, Marc wrote: > > Does it make sense? -> I have read "self::" all time as a shortcut for > "MyClass::" until I noticed this is not the case and I expect most PHP > devs would explain it this way. > > Is there a reason why self:: doesn't reset the internal "static"

Re: [PHP-DEV] Bug Wrong resolution of "Late Static Binding" after self::method()

2020-03-09 Thread Nikita Popov
On Mon, Mar 9, 2020 at 6:38 AM Marc wrote: > Hi, > > > On 08.03.20 17:54, Matthew Brown wrote: > > This is expected behaviour given my understanding of how late static > binding works: > > > > If there is a chain of “self::” calls that ultimately ends in > “static::someMethod”, then PHP behaves

[PHP-DEV] Re: Literal / Taint checking

2020-03-09 Thread Craig Francis
Hi, As I'm not sure how to make any more process on this, I've added added a Feature Request: https://bugs.php.net/bug.php?id=79359 It shows how this change in PHP could stop SQL injection, and proposes a way it could be used against HTML injection as well. Craig On Thu, 13 Feb 2020 at

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

2020-03-09 Thread Benjamin Eberlei
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

[PHP-DEV] [RFC] Attributes v2

2020-03-09 Thread Benjamin Eberlei
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

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

2020-03-09 Thread Stephen Reay
> On 9 Mar 2020, at 21:42, 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

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

2020-03-09 Thread Stephen Reay
> On 9 Mar 2020, at 23:27, Benjamin Eberlei wrote: > > > > On Mon, Mar 9, 2020 at 5:18 PM Stephen Reay > wrote: > > > > On 9 Mar 2020, at 21:42, Benjamin Eberlei > > wrote: > > > > Hi all, > > > > I want to resurrect Dmitrys

Re: [PHP-DEV] Re: Literal / Taint checking

2020-03-09 Thread Rowan Tommins
On Mon, 9 Mar 2020 at 13:47, Craig Francis wrote: > Hi, > > As I'm not sure how to make any more process on this, I've added added a > Feature Request: > > https://bugs.php.net/bug.php?id=79359 > > It shows how this change in PHP could stop SQL injection, and proposes a > way it could be used

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

2020-03-09 Thread Rowan Tommins
Hi Benjamin On Mon, 9 Mar 2020 at 14:43, 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 RFC is at

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

2020-03-09 Thread Benjamin Eberlei
On Mon, Mar 9, 2020 at 5:18 PM Stephen Reay wrote: > > > > On 9 Mar 2020, at 21:42, 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] [RFC] Attributes v2

2020-03-09 Thread Paul M. Jones
Hi Benjamin, From the examples, am I to understand that the RFC introduces a top-level namespace `\Php` ? -- Paul M. Jones pmjo...@pmjones.io http://paul-m-jones.com Modernizing Legacy Applications in PHP https://leanpub.com/mlaphp Solving the N+1 Problem in PHP https://leanpub.com/sn1php

Re: [PHP-DEV] Bug Wrong resolution of "Late Static Binding" after self::method()

2020-03-09 Thread Marc
Thank you all for explaining. This helps a lot! Marc On 09.03.20 10:27, Rowan Tommins wrote: On Mon, 9 Mar 2020 at 05:38, Marc wrote: Does it make sense? -> I have read "self::" all time as a shortcut for "MyClass::" until I noticed this is not the case and I expect most PHP devs would

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

2020-03-09 Thread Benjamin Eberlei
On Mon, Mar 9, 2020 at 6:18 PM Rowan Tommins wrote: > Hi Benjamin > > On Mon, 9 Mar 2020 at 14:43, 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

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

2020-03-09 Thread Matthew Brown
For information that's needed at runtime (as opposed to documentation or static analysis) docblocks have an obvious overh I think the syntax here looks great, and I think this would be an exciting addition to the language. I want to build things with it! On Mon, 9 Mar 2020 at 10:43, Benjamin

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

2020-03-09 Thread Andrea Faulds
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 RFC is at https://wiki.php.net/rfc/attributes_v2 Hi, I have concerns

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.

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

2020-03-09 Thread Robert Hickman
> > 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