---- En vie, 26 feb 2021 13:25:30 +0100 Michał Marcin Brzuchalski <michal.brzuchal...@gmail.com> escribió ---- > Personally, none of the above examples is convincing bc I'd implement them > using a fixed class names map to avoid loading untrusted classes. > Any kind of helper class is something I'd personally not use to avoid > static coupling of code and hacks while writing unit tests over > services that could be injected by IoC. > Full class names (whether they're aliased or used in use clause) have more > benefit over class name string operations as they're easy for any renaming > which most of the IDE's these days can handle. > IMO introducing namespace magic constant has relatively narrow use and I'd > probably vote NO on this. > > Cheers, > Michał Marcin Brzuchalski I see...
I agree with you, however one thing is as we would like PHP will be used and other is as it is used. - https://stackoverflow.com/questions/24798621/how-can-i-get-the-full-namespace-of-a-class-without-creating-an-instance-of-it - https://stackoverflow.com/questions/13932289/get-php-class-namespace-dynamically - https://stackoverflow.com/questions/43630010/php-how-can-get-the-namespace-of-class-method-parameter - https://stackoverflow.com/questions/28182783/get-namespace-of-an-object-using-an-abstract-class-or-trait/28182941 - ... It's like `eval`, it is dangerous, maybe it never should be used. However, sometimes is useful. do we avoid "dangerous" features ? or do we think people are professional( I don't know if this is used in English equal Spanish ) and they know using it when is needed ? I think that if something is common and normally useful, PHP should implement that. For example, `::namespace` or `get_namespace()` Regards -- Manuel Canga Zend Certified PHP Engineer Websites: https://manuelcanga.dev | https://trasweb.net Linkedin: https://es.linkedin.com/in/manuelcanga -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php