Hi Michał, George, On Wed, Apr 15, 2020 at 2:29 PM Michał Brzuchalski < michal.brzuchal...@gmail.com> wrote:
> Hi internals, > > I hope you're doing well. > > I'd like to announce the PHP Namespace in core RFC for discussion. > The RFC is authored by me together with George Peter Banyard and it's > purpose > is nothing more like to allow the use of PHP Namespace in the core. > > The RFC is described at https://wiki.php.net/rfc/php-namespace-in-core I think the php namespace for core is important to have, especially for features that have more than a single, but multiple classes, grouping them in a PHP internal namespace will be helpful to avoid weird prefixing. With the Attributes RFC in mind, an earlier draft has used the namespace PHP\Attributes that a few contributors rightly mentioned is a bad idea without project wide standardization first. For my taste, the RFC is great except the "A chance to clean up poor design/naming decisions" section. It goes into politics and controversial ideas that essentially are outside the scope of the RFC itself. So while SPL and Reflection would benefit if we had the namespace before those APIs, I am not sure they drive down the point of why we need this: a.) Instead of changing SPL I believe most would pretty much agree that we just need a complete replacement with a better API (pointing towards phpds here might be a better example) b.) Moving some new parts of Reflection into the namespace while keeping others in the main namespace is extremely confusing, and we shouldn't confuse users that way. Realistically this is an issue thats not going to be changed. I do like the Frame example, similar to token_get_all returning an array, debug_backtrace could benefit from an object based representation. I would reluctantly call it a "toy example", it is an actual example or not? greetings Benjamin > > > Best Regards, > Michał Brzuchalski >