Re: Attributes and constructor property promotion
| From: | Rowan Tommins | Date: | Tue, 06 Oct 2020 16:58:57 +0000 |
| Subject: | Re: Attributes and constructor property promotion | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112018@lists.php.net to get a copy of this message | ||
On Tue, 6 Oct 2020 at 17:20, Andreas Leathley <a.leathley@gmx.net> wrote:
> From my understanding suppressing the validation errors in this
> particular case would be a good solution, or are there any serious
> downsides to that?
>
The downside presumably is that a library author could implement an
attribute with a property-only restriction, and therefore write code
handling parameter attributes with the assumption that that attribute won't
be present. If a consumer of the library makes use of constructor property
promotion, that assumption can be violated. I can't quite picture what that
code would look like, though, since it's always necessary to filter the
list of attributes to exclude those from other libraries.
Regards,
--
Rowan Tommins
[IMSoP]