Greetings,

I would like to re-open the discussion on properly reserving the \PHP
namespace for the use of the engine and its core extensions.

Rather than seek to demand everything be moved into namespaces, I have
instead written this RFC as something that would form a policy
guideline for future development of the engine and those extensions
which are directly managed by internals.

At present, the accepted style is to "fake" a namespace by prefixing
symbols with Php.

As internals "claims" the top level namespace, this effectively means
that all userland code must exist in its own namespace, which is
indeed how almost all modern userland code is written, which if
anything this proves the benefit of namespacing.

In effect, this is both demanding a particular style, while choosing
not to use it ourselves.

Furthermore, based on the common understanding that a namespace owns
and is responsible for all of its descendants, our current arrangement
is that _all_ code belongs to PHP and that internals using _any_
namespaces at all could lead to a legitimate collision.

Finally, the \PHP namespace itself IS already noted in the
documentation to be reserved.
https://www.php.net/manual/en/language.namespaces.rationale.php

"The Namespace name PHP, and compound names starting with this name
(like PHP\Classes) are reserved for internal language use and should
not be used in the userspace code."

This RFC would formalise that notice, and give notice to internals
that the use of \PHP was permitted and encouraged.

https://wiki.php.net/rfc/php_namespace_policy

-- 
Mark Randall

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to