Re: [RFC] Constructor Property Promotion

From: Date: Wed, 06 May 2020 22:40:39 +0000
Subject: Re: [RFC] Constructor Property Promotion
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-110053@lists.php.net to get a copy of this message
Hi Nikita, Nikita Popov wrote:
On Thu, Mar 26, 2020 at 2:30 PM Nikita Popov <nikita.ppv@gmail.com> wrote: I think the best answer to this question may be to forbid the use of attributes on promoted properties entirely, because there is no unambiguous interpretation for them. I also think that using attributes pushes this "syntax sugar" to its limit, as you can easily end up with a 50 line constructor signature that way, at least if I'm going by some of the more involved uses of annotations...
I think that is a great starting point because it is a safe decision: if we later decide there is a better behaviour, we can change it without causing any problems for existing code. So, if we don't come up with a better idea, I would strongly recommend that one. I also agree with your other thoughts on it. :) Thanks, Andrea

« previous php.internals (#110053) next »