Re: [RFC] PHP Namespace Policy

From: Date: Wed, 15 Apr 2020 11:43:41 +0000
Subject: Re: [RFC] PHP Namespace Policy
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-109649@lists.php.net to get a copy of this message
On 15/04/2020 12:23, Derick Rethans wrote:
This will mean that in a future version of PHP, some things will live in a \PHP namespace, and others, such as DateTimeImmutable or Directory do not. We should not be introducing inconsistencies.
It notes that it should be the preferred method for new feature development, and intentionally stops short of requiring it, to provide plenty of room for leeway in cases like this where there is an obvious benefit to keeping features aligned.
Which means new additions to PHP 8, such as a potential PhpAttribute, now would have been \PHP\Engine\Attribute, while we already have PhpToken. That is another inconsistency that we don't need.
I would argue that both these two great new features would benefit from an additional level, unless of course we can guarentee that we would never introduce anything else into PHP called token, or attribute, at which point we are back to square one, a problem which can be almost all together avoided by adding a "feature" specific namespace under \PHP. -- Mark Randall marandall@php.net

« previous php.internals (#109649) next »