Re: [RFC] Amendments to Attributes
| From: | Peter Bowyer | Date: | Fri, 22 May 2020 11:55:44 +0000 |
| Subject: | Re: [RFC] Amendments to Attributes | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110245@lists.php.net to get a copy of this message | ||
On Fri, 22 May 2020 at 12:09, Nikita Popov <nikita.ppv@gmail.com> wrote:
> While I'm happy with "Attribute" living in the global
> namespace, I don't really think we'd want to introduce "Jit" as a class in
> the global namespace. The name is simply to generic and does not indicate
> that this is part of the attribute system. We'd be forced to go with things
> like DeprecatedAttribute or JitAttribute, which seems rather non-optimal to
> me, as we're just reinventing namespaces to avoid using them...
>
> As such, I would suggest to introduce a common namespace for all attributes
> provided by PHP. This means we'd have Attributes\Attribute,
> Attributes\Deprecated, Attributes\Jit, Attributes\NoJit etc. (I'm also okay
> with the PHP\Attributes\Deprecated variant, but that's a separate
> question).
>
This is the best real-world argument in favour of PHP namespace in core
that I've heard.
https://wiki.php.net/rfc/php-namespace-in-core
If we don't want to introduce classes in the global namespace, it makes
sense to have a reserved PHP namespace we use.
Peter